Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > C - C++ Learning > Re: Is fork() b...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 5 of 6 Topic 4073 of 4295
Post > Topic >>

Re: Is fork() bad or dangerous?

by Hal Vaughan <hal@[EMAIL PROTECTED] > Mar 17, 2008 at 01:16 AM

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
 




 6 Posts in Topic:
Is fork() bad or dangerous?
Hal Vaughan <hal@[EMAI  2008-03-16 23:30:29 
Re: Is fork() bad or dangerous?
Ian Collins <ian-news@  2008-03-17 13:46:00 
Re: Is fork() bad or dangerous?
Hal Vaughan <hal@[EMAI  2008-03-17 00:47:31 
Re: Is fork() bad or dangerous?
Jeff Schwab <jeff@[EMA  2008-03-16 18:08:59 
Re: Is fork() bad or dangerous?
Hal Vaughan <hal@[EMAI  2008-03-17 01:16:04 
Re: Is fork() bad or dangerous?
Jeff Schwab <jeff@[EMA  2008-03-16 20:57:16 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Mon Oct 6 15:55:53 CDT 2008.