Original Post
Hi!
Here's simple tight server loop with yield:
static void *mainServerLoop(void *s) {
while(running) {
// ...
nlThreadYield();
}
}
Then I have two cases:
CASE 1.
void main() {
/* start the server thread */
tid = nlThreadCreate(mainServerLoop, 0, NL_TRUE);
nlThreadJoin(tid, (void **)&exitcode);
}
CASE 2.
void main() {
/* run server without thread */
mainServerLoop(0);
}
The problem is that case 1 eats up all processor time so that client application with 3d opengl graphics is damn slow. Also all other windows apps run very slow.
However case 2 works much better.
Why doesn't case 1 yield work to give time for other apps?
Thanks.
[edited by - stefu on July 24, 2002 4:28:33 AM]