Andrew Gaylard | 2 May 15:18

Re: PipeStreams (aka. generators)

Hi Michael,

On Fri, May 2, 2008 at 3:04 PM, Michael FIG <michael-y8U0i/lyZOM@public.gmane.org> wrote:

The only downside I can see is that <ucontext.h> is not all that
common.  

A quick answer to your question: ucontext.h is part of the Single Unix
Specification, a superset of POSIX.1.  It is included in FreeBSD 5.2.1,
Linux 2.4.22, MacOS 10.3, and Solaris 9.  This is according to
"Advanced Programming in the Unix Environment" by Stevens and Rago,
second edition, p.30, a book I can recommend for answers to these
sorts of questions.
 
I don't know if something like it exists for Windows
(actually, NT Fibers could be abused to provide the same thing, I
think) or MacOS.  GNU Pth provides similar functionality, so it may be
possible to learn how to reimplement the context-switching features on
other platforms.

Of course, this doesn't say anything about Windows.  So I wouldn't bet
the farm on it working under Windows...

Andrew

<div>
<p>Hi Michael,<br><br></p>
<div class="gmail_quote">On Fri, May 2, 2008 at 3:04 PM, Michael FIG &lt;<a href="mailto:michael@...">michael@...</a>&gt; wrote:<br><blockquote class="gmail_quote">
<br>
The only downside I can see is that &lt;ucontext.h&gt; is not all that<br>
common. &nbsp;</blockquote>
<div>
<br>A quick answer to your question: ucontext.h is part of the Single Unix<br>
Specification, a superset of POSIX.1.&nbsp; It is included in FreeBSD 5.2.1,<br>
Linux 2.4.22, MacOS 10.3, and Solaris 9.&nbsp; This is according to<br>
"Advanced Programming in the Unix Environment" by Stevens and Rago,<br>
second edition, p.30, a book I can recommend for answers to these<br>
sorts of questions.<br>&nbsp;
<br>
</div>
<blockquote class="gmail_quote">I don't know if something like it exists for Windows<br>
(actually, NT Fibers could be abused to provide the same thing, I<br>
think) or MacOS. &nbsp;GNU Pth provides similar functionality, so it may be<br>
possible to learn how to reimplement the context-switching features on<br>
other platforms.</blockquote>
<div>
<br>Of course, this doesn't say anything about Windows.&nbsp; So I wouldn't bet<br>
the farm on it working under Windows...<br><br>Andrew<br>
</div>
</div>
<br>
</div>

Gmane