Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 No Way to stop processes? URGENT
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
cam




PostPosted: Wed Jan 24, 2007 4:32 pm   Post subject: No Way to stop processes? URGENT

I really need to stop it for my read and write file at the end to work...
Can some teach me how to stop fork?
I can't really change the whole program much any more...
Sponsor
Sponsor
Sponsor
sponsor
ericfourfour




PostPosted: Wed Jan 24, 2007 5:14 pm   Post subject: RE:No Way to stop processes? URGENT

Well, the best advice I can give you is: don't use processes.
Cervantes




PostPosted: Wed Jan 24, 2007 5:22 pm   Post subject: RE:No Way to stop processes? URGENT

ericfourfour's advice is correct, but if you're stuck and you don't have the time to change the structure of your code too much, I'll offer another solution.

I suspect you've got a loop inside the process that you've forked. Give the loop and exit condition. That condition will be the same as the condition that made you want to stop your fork. (This might require using a global boolean value, depending on the condition.)
cam




PostPosted: Wed Jan 24, 2007 5:30 pm   Post subject: Re: RE:No Way to stop processes? URGENT

Cervantes @ Wed Jan 24, 2007 5:22 pm wrote:
ericfourfour's advice is correct, but if you're stuck and you don't have the time to change the structure of your code too much, I'll offer another solution.

I suspect you've got a loop inside the process that you've forked. Give the loop and exit condition. That condition will be the same as the condition that made you want to stop your fork. (This might require using a global boolean value, depending on the condition.)


thx
Clayton




PostPosted: Wed Jan 24, 2007 6:23 pm   Post subject: Re: No Way to stop processes? URGENT

or, if you've got some code after said loop, I believe return will work as well. just have an if statement, and if it's true, execute the return statement.
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 5 Posts ]
Jump to:   


Style:  
Search: