Jun 20, 2013 #1 K kansagaratushar Newbie level 5 Joined Jan 7, 2013 Messages 8 Helped 1 Reputation 2 Reaction score 1 Trophy points 1,283 Activity points 1,338 with use of fork join /fork join_none/ fork join_any how can I complete exact 2 concuttent processes out of 4 processes...? It means.. fork process1; process2; process3; process4; join/join_any/join_none output: process1 process2
with use of fork join /fork join_none/ fork join_any how can I complete exact 2 concuttent processes out of 4 processes...? It means.. fork process1; process2; process3; process4; join/join_any/join_none output: process1 process2
Jun 20, 2013 #2 D dave_59 Advanced Member level 3 Joined Dec 15, 2011 Messages 838 Helped 365 Reputation 734 Reaction score 360 Trophy points 1,353 Location Fremont, CA, USA Activity points 7,369 I am assuming you want ANY 2 processes out of 4 Code: begin int N = 4; fork begin process1; N--; end begin process2; N--; end begin process3; N--; end begin process4; N--; end join_none wait(N==2); disable fork; // kills remaining process if that is what you want to do end
I am assuming you want ANY 2 processes out of 4 Code: begin int N = 4; fork begin process1; N--; end begin process2; N--; end begin process3; N--; end begin process4; N--; end join_none wait(N==2); disable fork; // kills remaining process if that is what you want to do end
Aug 7, 2013 #3 K kansagaratushar Newbie level 5 Joined Jan 7, 2013 Messages 8 Helped 1 Reputation 2 Reaction score 1 Trophy points 1,283 Activity points 1,338 Thanks Dave...