Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > Process synchronization problem...

Reply
Thread Tools

Process synchronization problem...

 
 
mchethan@gmail.com
Guest
Posts: n/a
 
      11-08-2005
There is a problem in the fork script I am writing.
The below mentioned code pseudocode fails to process properly and uses
the partially processed data from the first forked child.

if(pid1 = fork()) {

process something..
 
Reply With Quote
 
 
 
 
xhoster@gmail.com
Guest
Posts: n/a
 
      11-08-2005
http://www.velocityreviews.com/forums/(E-Mail Removed) wrote:
> There is a problem in the fork script I am writing.
> The below mentioned code pseudocode fails to process properly and uses
> the partially processed data from the first forked child.


Pseudocode always fails to process properly. That is why we program in
Perl, rather than psuedocode. You should try it sometime.



> if(pid1 = fork()) {
> process something..
> waitpid (pid1, 1)


A nonblocking waitpid in which you don't check the return
value--Why bother doing it in the first place?
....


> where as the below mentioned code works perfectly.


The below mentioned code doesn't even have balanced curlies.


> Can someone please help me identify the reson why the first code piece
> is failing?


If you post real code, I very well might be able to. You could replace
"process something" with a very simple scalar increment or array push or
pop, to properly demonstrate the problem. (And if you can't, then the
problem probably lies within "process something" rather than in the parts
you showed us.)

Xho

--
-------------------- http://NewsReader.Com/ --------------------
Usenet Newsgroup Service $9.95/Month 30GB
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Light (general) Inter-Process Mutex/Wait/Notify Synchronization? Gunter Henriksen Python 13 05-01-2009 09:40 AM
explaining the process take makes the lack of synchronization here fails fabrulous@yahoo.fr Java 2 07-14-2006 03:48 PM
synchronization Firefox 0 04-12-2005 03:44 PM
System Time synchronization arcvonz ASP .Net 2 08-23-2004 10:17 PM
Flip Flop Synchronization John VHDL 3 01-05-2004 05:58 PM



Advertisments