Message-ID: <8D53104ECD0CD211AF4000A0C9D60AE335BE25@probe-2.Acclaim-Euro.net> From: Shawn Hargreaves To: Eli Zaretskii Cc: djgpp AT delorie DOT com Subject: RE: how to switch tasks? Date: Thu, 17 Dec 1998 15:20:04 -0000 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.0.1460.8) Content-Type: text/plain Reply-To: djgpp AT delorie DOT com > Eli Zaretskii writes: >> I think you can do it by using the signal handling mechanism to defer >> the event into a protected mode exception, and then using setjmp() / >> longjmp(). > > True, but the original poster wanted to use task-switching to emulate > things like fork(), and that's not possible with signals, since once you > spawn another pogram, you are parked inside a real-mode DOS call, and all > signals are effectively disabled until the child program exits. A good point: I missed that part of the discussion. You could still implement a signal-based version of fork() when spawning a djgpp program from another djgpp application, since that can be done without ever bothering to invoke DOS, but this is quite a hairy assumption to make, and a big restriction on when the method could be used... Shawn Hargreaves.