Jeff Schwab wrote:
> Hal Vaughan wrote:
>> Ian Collins wrote:
>>
>>> Hal Vaughan wrote:
>>>> I've been researching threads and, since I'm coming from Perl, where
>>>> fork()
>>>> is used, that was my first thought. I've noticed, while searching,
>>>> that
>>>> there isn't as much on fork() in C++ as one would expect. Is there a
>>>> reason for this? Is fork() considered dangerous or a command to
avoid?
>>>>
>>> fork() is a library function, not a command.
>>>
>>> You won't see fork() discussed in a C++ context because it is not part
>>> of the language (or part of C), it is a POSIX standard function. So
you
>>> will see it discussed extensively in UNIX texts or on
>>> comp.unix.programmer.
>>
>> Which also explains why it's not mentioned in so many sites. But the
few
>> that did referred to it like it's standard.
>
> It is standard, just not part of the C or C++ standards. :) POSIX is a
> very popular API for writing ****table programs, especially in C.
So if I use fork() does that mean it won't work on Windows? It looks like
there are implementations of POSIX libraries for Windows and non-Unix
platforms.
I don't expect this program to be used on anything other than Linux, but
it's always better to be open-ended about such things than not.
In the meanwhile I'm finally looking into Boost and notice that their
libraries are multi-platform, so I'll most likely use that, but it always
helps to know other possibilities as well.
Thanks!
Hal


|