[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [Fwd: [pthreads-devel] no more thread scheduling when waitpidin one thread]

Howell, David P wrote:
> Looking at the test case, what is expected is "fair" scheduling between
> a 
> thread and a process without any synchronization. While 1-1 may provide 
> this behavior, I am dubious if this is what POSIX mandates or if the M:N
> behavior is wrong.

POSIX of course does never require concurrency.  But if you are trying
behind this, why bother at all with an m-on-n implementation.  Just have
one thread running all the time until it terminates.  Of course this
won't work at all.  But why bringing this up in defence then?

Fact is, that for m-on-n implementations the goal is and must be that no
syscall is blocked in the kernel.  Period.  If this goal isn't met the
implementation at the very least does not fulfill the user's expectations.

> Using POSIX locks in an appropriate way in the test
> case would guarentee the behavior either way.

I'm the last person to defend shitty programming but the code in
question, if you imagine real work being done where there are sleep()s,
it's perfectly sensible.  An implementation which requires the user to
program a certain way is hardly worth it.  If this would be acceptable
to the user it would be much better to go with a cooperative thread
library which can perform much better.

--------------.                        ,-.            444 Castro Street
Ulrich Drepper \    ,-----------------'   \ Mountain View, CA 94041 USA
Red Hat         `--' drepper at redhat.com `---------------------------

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]