Copying APR, because this is becoming an APR issue quickly.
> > > From: [EMAIL PROTECTED] [mailto:trawick@rdu88-251- > > > > > > "Bill Stoddard" <[EMAIL PROTECTED]> writes: > > > > > > > Is there a unix equivalent to the Win32 Sleep(0) call? If so, then > > we > > > can rip out all this > > > > cruft and use the patch I posted earlier. > > > > > > google for pthread_yield() and compare the doc with the doc for > > > Win32's Sleep(0). I suspect it is the same as long as we're dealing > > > with pthreads. > > > > The biggest problem with pthread_yield is that it doesn't always do > > anything. Some pthreads implementations don't really implement > > pthread_yield, in fact, if I remember correctly AIX is one of those. > > You are thinking about the old draft 7 pthread implementation in AIX 4.? > (where ?=2 if I > recall correctly). Yep, you are correct, even down to AIX 4.2. > > > I > > could be wrong about AIX though. I do know that when I first wrote the > > APR thread library, I specifically left out yield because it had > > different results on different platforms. > > You may be right but I would -hope- that a spec pthread implementation > would handle > pthread_yield() correctly... The problem is that Single Unix doesn't even define pthread_yield, and neither does the pthreads spec if I am reading it right. It looks like they both require sched_yield, which should do the same thing, however. All I am saying is that this isn't a panacea, a lot more research would be needed before pthread_ or sched_ yield could be considered portable. Ryan
