Xref: utzoo comp.os.msdos.programmer:4329 comp.os.os2.programmer:561 Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!uwm.edu!ogicse!unicorn!kevinj From: kevinj@unicorn.cc.wwu.edu (Kevin Johnson) Newsgroups: comp.os.msdos.programmer,comp.os.os2.programmer Subject: Re: Info on Changing Stacks in protected mode Message-ID: <1991Mar29.183850.27619@unicorn.cc.wwu.edu> Date: 29 Mar 91 18:38:50 GMT References: <1991Mar29.155840.2626@netcom.COM> Organization: Western Washington University, Bellingham WA. Lines: 24 resnicks@netcom.COM (Steve Resnick) writes: >I saw this article in C User's Journal about multi-threaded C using >setjmp/longjmp. This was something proposed to me a while ago, and thought >I'd try and work up my own code. After looking at the code I realized that >each thread is going to need a new stack. Assembler in hand, I write this >fairly generic assembler routine which launches the new thread with a new >stack. Everything works great until I run this under OS/2 rather than MS DOS. >OS/2 will not let me clear interrupts while changing SS:SP. My question: >Is it necessary to disable interrupts while switching stacks in protected >mode? I always thought it was necessary, and that's how I do it. Of course, I'm not an expert on the issue. >If so, what is the appropriate meathod under OS/2? Is there a call >to prevent task switching/interrupt processing? Or, should it be implemented >as part of an IOPL segment? Under OS/2, you will want the stack switching code to be in its own segment, then make that segment have IOPL privileges. --Kevin