X-Authentication-Warning: delorie.com: mailnull set sender to djgpp-bounces using -f Date: Mon, 10 Dec 2001 11:05:11 +0200 (IST) From: Eli Zaretskii X-Sender: eliz AT is To: Derek cc: djgpp AT delorie DOT com Subject: Re: Does LWP need a coprocessor? 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 Sun, 9 Dec 2001, Derek wrote: > I compiled a program that uses the LWP multitasking library but was unable > to run it on a 386 machine. I got this message: > > Exiting due to signal SIGNOFP > Coprocessor not available at eip=000035e7 > ... > > > My machine does not have a math coprocessor. Do simple programs that use floating-point computations run on that machine, or do they all bail out with a similar message? In any case, I suggest you set 387=n in the environment and try again. > Or maybe I don't need to multithread? Here's my situation: I need to > constantly monitor the serial port while also doing a second countdown timer > from 15. To the best of my knowledge, the timer would require using sleep(1) > but this would also pause the serial checking loop if I had both processes > in the same function. So is there any other option besides multithreading? It sounds like you could use a timer instead. Timers work by delivering a SIGALRM signal to your progra when time's up. You then run your code from a signal handler. For more details, read about the setitimer function in the library reference docs. Note that in DJGPP, signal delivery is delayed when the program is not in protected mode (like when it's in a DOS system call). But LWP uses signals as well, so it is prone to the same deficiencies.