The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > High Level Programming
Google UNIX.COM


High Level Programming Post questions about C, C++, Java, SQL, and other programming languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
getting the return code of forked child process (ftp) KittyJ High Level Programming 7 08-19-2007 12:44 AM
display in a child process a command called in the parent one remid1985 High Level Programming 7 01-19-2007 02:40 PM
how to find the chid process id from given parent process id guhas Shell Programming and Scripting 3 10-13-2005 05:13 AM
Implementing 2 pipes between a parent and child process bwgoudey High Level Programming 2 09-24-2005 08:14 PM
parent and child process question? tosa High Level Programming 0 02-16-2005 11:04 AM

Reply
 
LinkBack Thread Tools Display Modes
  #8 (permalink)  
Old 04-07-2008
Registered User
 

Join Date: Dec 2007
Location: Virginia, USA.
Posts: 232
That's because windows uses a threaded model, mandatory locking and various other design practices that were regarded as too complex by most *nix OS designers in regards to userspace applications.

I'd submit, humbly, that in my experience with MS products they were not far wrong.
Reply With Quote
Forum Sponsor
  #9 (permalink)  
Old 04-09-2008
Registered User
 

Join Date: Apr 2008
Posts: 5
But with a small change ..

If there is no particular reason that you are using fork() and exec() to create the child process, you could make your child.c a non-main function and, instead of exec()-ing it, call it as a function after the fork():

// in main

if ( 0 == (pid = fork() ))
child(int values_needed, ..., int *value_to_return);
exit(...);
else
// parent code here.

This WILL solve your problem without IPC or shared memory if you simply pass parameters to the child.

Hope this helps.

Stewartw
Reply With Quote
Google UNIX.COM
Reply

Tags
linux

Thread Tools
Display Modes




All times are GMT -7. The time now is 08:54 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008 The CEP Blog All Rights Reserved -Ad Management by RedTyger Visit The Global Fact Book

Content Relevant URLs by vBSEO 3.2.0