| Barry Margolin 2005-04-08, 8:48 pm |
| In article <1112990830.493356.96350@z14g2000cwz.googlegroups.com>,
"James" <james_unix@yahoo.com> wrote:
> Hi,
> I've made my own user level thread package using setjmp/longjmp
> mechanism. However the problem in them is that if an infinite while
> loop is present in any thread then the other thread/s never gets a
> chance to run. I've seen the same problem in some other thread packages
> also. So can somebody please tell me that is this problem a loophole in
> my package(as well as other packages ) or it is a part of the user
> level thread properties.
It's a problem with any non-preemptive multitasking design. If you
require a task to voluntarily give up the processor, you run the risk
that a task may not volunteer, and will monopolize the system.
--
Barry Margolin, barmar@alum.mit.edu
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***
|