ÿØÿà JFIF    ÿÛ „  ( %!1!%)+//.383,7(-.+  -%%-////---/-.+/--+------/------/--0+--/-/-----.-----ÿÀ  ¥2" ÿÄ     ÿÄ J    ! 1AQ"aq2‘#BR‚¡ÁÑ3br’¢±Âð$CSƒ²á4c“%DsÓñÿÄ   ÿÄ *  !1AQa‘"2q3±ð#b¡ÿÚ   ? ¼QxJQaÍuò¸Zö Úü8,ÐÚú "SSn<rçù–´âE—^ªBÖ9À\†¸ÔÁT­ÃÛ5 ëd´³Í#Ý;Þ38œî ¶H£M:wÎ3…³…âpÔF&‚FK¸9„â4àGEõªfÿ ‘ñ(ßw­pŽF|È¥ù®häðÍѶ¹‘[ÒinÙW¶ùñY˜Q{›K"išÒ[Ú8žë\F¹@-?v"ÔU”,ìöžkÿ {I‡£šÍ?e ríV ?> ......................................... ............................................................................. ÿØÿà JFIF    ÿÛ „  ( %!1!%)+//.383,7(-.+  -%%-////---/-.+/--+------/------/--0+--/-/-----.-----ÿÀ  ¥2" ÿÄ     ÿÄ J    ! 1AQ"aq2‘#BR‚¡ÁÑ3br’¢±Âð$CSƒ²á4c“%DsÓñÿÄ   ÿÄ *  !1AQa‘"2q3±ð#b¡ÿÚ   ? ¼QxJQaÍuò¸Zö Úü8,ÐÚú "SSn<rçù–´âE—^ªBÖ9À\†¸ÔÁT­ÃÛ5 ëd´³Í#Ý;Þ38œî ¶H£M:wÎ3…³…âpÔF&‚FK¸9„â4àGEõªfÿ ‘ñ(ßw­pŽF|È¥ù®häðÍѶ¹‘[ÒinÙW¶ùñY˜Q{›K"išÒ[Ú8žë\F¹@-?v"ÔU”,ìöžkÿ {I‡£šÍ?e ríV ?> ......................................... ............................................................................. ???????????????????????????????????? ???????????????????????????????????? ÿØÿà JFIF    ÿÛ „  ( %!1!%)+//.383,7(-.+  -%%-////---/-.+/--+------/------/--0+--/-/-----.-----ÿÀ  ¥2" ÿÄ     ÿÄ J    ! 1AQ"aq2‘#BR‚¡ÁÑ3br’¢±Âð$CSƒ²á4c“%DsÓñÿÄ   ÿÄ *  !1AQa‘"2q3±ð#b¡ÿÚ   ? ¼QxJQaÍuò¸Zö Úü8,ÐÚú "SSn<rçù–´âE—^ªBÖ9À\†¸ÔÁT­ÃÛ5 ëd´³Í#Ý;Þ38œî ¶H£M:wÎ3…³…âpÔF&‚FK¸9„â4àGEõªfÿ ‘ñ(ßw­pŽF|È¥ù®häðÍѶ¹‘[ÒinÙW¶ùñY˜Q{›K"išÒ[Ú8žë\F¹@-?v"ÔU”,ìöžkÿ {I‡£šÍ?e ríV ?> ......................................... ............................................................................. ÿØÿà JFIF    ÿÛ „  ( %!1!%)+//.383,7(-.+  -%%-////---/-.+/--+------/------/--0+--/-/-----.-----ÿÀ  ¥2" ÿÄ     ÿÄ J    ! 1AQ"aq2‘#BR‚¡ÁÑ3br’¢±Âð$CSƒ²á4c“%DsÓñÿÄ   ÿÄ *  !1AQa‘"2q3±ð#b¡ÿÚ   ? ¼QxJQaÍuò¸Zö Úü8,ÐÚú "SSn<rçù–´âE—^ªBÖ9À\†¸ÔÁT­ÃÛ5 ëd´³Í#Ý;Þ38œî ¶H£M:wÎ3…³…âpÔF&‚FK¸9„â4àGEõªfÿ ‘ñ(ßw­pŽF|È¥ù®häðÍѶ¹‘[ÒinÙW¶ùñY˜Q{›K"išÒ[Ú8žë\F¹@-?v"ÔU”,ìöžkÿ {I‡£šÍ?e ríV ?> ......................................... ............................................................................. ???????????????????????????????????? ???????????????????????????????????? U:RDoc::AnyMethod[iI" fork:ETI"Kernel#fork;TF: publico:RDoc::Markup::Document: @parts[!o:RDoc::Markup::Paragraph; [I"Creates a child process.;To:RDoc::Markup::BlankLineo; ; [I">With a block given, runs the block in the child process; ;TI"?on block exit, the child terminates with a status of zero:;T@o:RDoc::Markup::Verbatim; [ I",puts "Before the fork: #{Process.pid}" ;TI" fork do ;TI"3 puts "In the child process: #{Process.pid}" ;TI"'end # => 382141 ;TI"+puts "After the fork: #{Process.pid}" ;T: @format0o; ; [I" Output:;T@o; ; [I"Before the fork: 420496 ;TI"After the fork: 420496 ;TI""In the child process: 420520 ;T; 0o; ; [I"8With no block given, the +fork+ call returns twice:;T@o:RDoc::Markup::List: @type: BULLET: @items[o:RDoc::Markup::ListItem: @label0; [o; ; [I"HOnce in the parent process, returning the pid of the child process.;To;;0; [o; ; [I"0Once in the child process, returning +nil+.;T@o; ; [I" Example:;T@o; ; [I"Hputs "This is the first line before the fork (pid #{Process.pid})" ;TI"puts fork ;TI"Hputs "This is the second line after the fork (pid #{Process.pid})" ;T; 0o; ; [I" Output:;T@o; ; [ I"9This is the first line before the fork (pid 420199) ;TI" 420223 ;TI"9This is the second line after the fork (pid 420199) ;TI" ;TI"9This is the second line after the fork (pid 420223) ;T; 0o; ; [I"6In either case, the child process may exit using ;TI"6Kernel.exit! to avoid the call to Kernel#at_exit.;T@o; ; [I"FTo avoid zombie processes, the parent process should call either:;T@o;;;;[o;;0; [o; ; [I"GProcess.wait, to collect the termination statuses of its children.;To;;0; [o; ; [I"=Process.detach, to register disinterest in their status.;T@o; ; [I"PThe thread calling +fork+ is the only thread in the created child process; ;TI"'+fork+ doesn't copy other threads.;T@o; ; [I"=Note that method +fork+ is available on some platforms, ;TI"but not on others:;T@o; ; [I"DProcess.respond_to?(:fork) # => true # Would be false on some. ;T; 0o; ; [I"3If not, you may use ::spawn instead of +fork+.;T: @fileI"process.c;T:0@omit_headings_from_table_of_contents_below0I"KProcess.fork { ... } -> integer or nil Process.fork -> integer or nil ;T0[I"();T@dFI" Kernel;TcRDoc::NormalModule00