Re: GNU-Pth and GLIB



On Wed, Oct 04, 2000 at 02:20:14PM -0400, otaylor redhat com wrote:
> 
> Jonas Bulow <jonas bulow servicefactory se> writes:
> > In an event driven server application it can be usefull to have a
> > non-preemtive thread implementation. I found it easier to keep data
> > consistent because no locking of data is needed. Of course there are a
> > few assumptions that have to be true, for example processing time for an
> > event should be minimized between calls to a yielding function.
> 
> Well, perhaps, though I'd be worried about accidentally forgetting
> to make sure that I was reentrant over a call to, say, read() which
> yielded when I wasn't expecting it to.

argh, be careful here, there is a big difference between how you use
non-preemptive threads and preemptive threads (if you wish to utilize
the preemtiveness properties), glib should definatly NOT pretend they
are the same thing if people are expecting to be using the glibthreads
in a particular manner. there is a very useful place for non-preemptive
threads but it is a different task than what the glib threads try to
provide, for a good non-preemptive threads library see
http://oss.sgi.com/projects/state-threads/ which are well implemented
and a good introduction to what can be done with non-preemptive threads.
usually when speaking of threads, and what glib threads seems to export
are the preemptive variety which require things like mutexs and whatnot
to maintain consistancy. non-preemtive threads give that up, but at the
cost of concurrency in many situations which have to be worked around by
the user.


-- 
--------------------------------------------------------------
John Meacham   http://repetae.net/~john/   john repetae net
California Institute of Technology, Alum.  john foo net
--------------------------------------------------------------




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