Just call sleep instead of cede if it works better.
But you may want to consider the output I got from different sleep lengths in the second thread. I changed from printing the length to print time().
Using sleep(0), it takes 9s to do a request.
first
second
second
second
second
second
second
second
second
second
second
second
second
second
second
second
second
1302281756
second
first
second
second
second
second
second
second
second
second
second
second
second
second
second
second
second
second
second
1302281765
Using sleep(1), it takes 2s to do a request.
first
second
second
second
1302281791
first
second
second
1302281793
first
second
second
1302281795
Using sleep(2), it takes 1s to do a request.
first
second
1302281819
first
second
1302281820
first
second
1302281822
first
1302281823
|