I don't know much about the specifics of linuxthreads, but pthreads are
usually implemented with a group of kernel threads (supplied by clone()
syscall in this case, and they're definitely "light-weight" processes).
Perhaps, they've been referred to as "heavy-weight" just as a term
relative to green threads, since green threads have all of their state
switched in user-level(?) calls sigsetjmp and siglongjmp.
>From the discussion so far, it sounds like Java green threads are supposed
to provide unfair behavior (computationally bound threads can indefinitely
preempt like or lower priority threads). I haven't looked at the native
thread Java scheduler, but I presume that like priority, runnable Java
threads would be mapped to like priority, runnable pthreads. In which
case, the green threads and native threads will differ wildly in their
scheduling behavior.
David
On Sun, 7 Feb 1999, Dimitris Vyzovitis wrote:
> Gerald Gutierrez wrote:
>
> >
> >
> > Non-Java processes don't have the problem because "processes" are
> > heavyweight native threads, essentially. Non-Java threads MAY have the
> > problem if they are not native threads.
> >
> > Assuming you are talking about Linux when you talk about G++, yes Linux
> > implements a time slicing mechanism. I don't think it implements preemption.
> >
>
> This makes me wonder.
> AFAIK, according to their definition, threads are supposed to be "lightweight"
> processes.
> How are linuxthreads actually implemented? ie, do we get the real lightweight
> process that we are supposed to get by the pthreads definitions?
> The descriptions seen in the discussion so far imply that this is not the case,
> while it should be (and we should not have to worry that much about overhead ;-}
> )
>
> thanx,
> Dimitris
>
>
>
>