From: bootsektor Newsgroups: comp.os.msdos.djgpp Subject: threading Date: Sun, 09 Mar 1997 19:37:23 +0800 Organization: dk technology Lines: 16 Message-ID: <3322A0F3.7349@tm.net.my> NNTP-Posting-Host: png-30-62.tm.net.my Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Hi. I was wondering if it is possible to implement a tasker as shown below. The main scheduler is an IRQ server which serves the timer interrupt. Then, the tasks are implemented with the i386's internal TSS mechanism. The task, in fact is a scheduler on its own right, scheduling threads which make up a program. Ok. The problem is this. Once the scheduler is defined, there is no definite way to trace back the caller's CS:EIP, and to save the processor state. In real mode, there is practically no problem; save whatever is necessary in the caller's stack, and then, do thread processing to determine the next thread. After that, change the stack to reflect the next thread, pop registers and iret. If someone has any other ideas, i'd like to hear them ;) regards, -bootsektor-