Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!shadooby!ginosko!uunet!ficc!peter From: peter@ficc.uu.net (Peter da Silva) Newsgroups: comp.lang.c Subject: Re: threads for C/C++ under Unix? Message-ID: <6530@ficc.uu.net> Date: 14 Oct 89 01:50:26 GMT References: <12298@polya.Stanford.EDU> Reply-To: peter@ficc.uu.net (Peter da Silva) Organization: Xenix Support, FICC Lines: 15 In article (Skip Montanaro) writes: > You can't have preemptive lightweight processes without kernel support. Well, this is a bit of a pleonasm, but all the "kernel support" you need is alarm(1) and signal(SIGALRM, switch). The quantum is a bit long, but it'll work. You'll have to rewrite stdio to recover from interrupted system calls, of course, as well as putting semaphores around the likes of malloc(). The question is whether pre-emptive threads are desirable. Non-preemptive threads are a lot easier to deal with. -- Peter da Silva, *NIX support guy @ Ferranti International Controls Corporation. Biz: peter@ficc.uu.net, +1 713 274 5180. Fun: peter@sugar.hackercorp.com. `-_-' 'U` Quote: Structured Programming is a discipline -- not a straitjacket.