X-Authentication-Warning: delorie.com: mailnull set sender to djgpp-bounces using -f Date: Tue, 29 Jan 2002 12:19:15 +0200 (IST) From: Eli Zaretskii X-Sender: eliz AT is To: Christophe BARIBAUD cc: djgpp AT delorie DOT com Subject: Re: multi-threading In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Reply-To: djgpp AT delorie DOT com Errors-To: nobody AT delorie DOT com X-Mailing-List: djgpp AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk On Tue, 29 Jan 2002, Christophe BARIBAUD wrote: > I do think that a pre-emptive multi-threading kernel under MS-DOS is a wrong > way, since DJGPP libraries, DPMI and DOS aren't reentrant. 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.