Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!taumet!steve From: steve@taumet.com (Stephen Clamage) Newsgroups: comp.lang.c++ Subject: Re: The Scheduler in the Task.h class consumes CPU when idle. Keywords: tasks task.h cpu Message-ID: <518@taumet.com> Date: 18 Nov 90 00:34:28 GMT References: <1990Nov7.034557.7605@clear.com> Organization: Taumetric Corporation, San Diego Lines: 24 rmartin@worf.clear.com (Bob Martin) writes: |I have been experimenting with the "task.h" classes in the Sun |distribution of C++ 2.0. I have been able to create tasks which |are happy to share the CPU as true coroutines. I have also been |able to use the Interrupt class to catch timer signals in order to |implement timed delays for tasks. However, when all tasks are |blocked, waiting for an interrupt, the scheduler seems to hang |in an infinite loop consuming as much of the CPU as it can. |Does anybody out there know how to fix this problem. I would like |to use the task class, but cannot afford to have a process eat all |the available cpu. The implementation of the AT&T tasking library from Oregon Software sleeps while waiting for interrupts, rather than busy-waiting. You might want to try it. It does require the Oregon compiler, as it assumes Oregon-specific code generation. The tasking library is presently available for the Sun 3 series. Disclaimer: I wrote the implementation. -- Steve Clamage, TauMetric Corp, steve@taumet.com