X-Authentication-Warning: delorie.com: mailnull set sender to djgpp-bounces using -f From: "Florian Schulze" Newsgroups: comp.os.msdos.djgpp Subject: Re: multi-threading Date: Tue, 29 Jan 2002 11:56:20 +0100 Organization: T-Online Lines: 18 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: news.t-online.com 1012302074 00 4980 tHCjT01SSmHkjT 020129 11:01:14 X-Complaints-To: abuse AT t-online DOT com X-Sender: 510037581706-0001 AT t-dialin DOT net X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4522.1200 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com > Nevertheless, you could still have preemptive threading if you are > willing to accept the limitation that thread switch would be delayed > until system calls (DPMI and DOS calls) return. This limitation is > certainly no worse than cooperative threading. > > If this limitation is okay, you can build your scheduler as a handler for > some signal, like SIGALRM, and use timers to preempt threads. This is how it's done in LWP. Is a signal really processed after all system calls? That would be good to know, as I'm using LWP for some project and I could make my work a little bit easier if I know. I guess the only places where I have to be carfull, are functions which save an internal state. Florian