Revision: 1055
http://svn.sourceforge.net/r-gregmisc/?rev=1055&view=rev
Author: warnes
Date: 2007-02-15 10:40:06 -0800 (Thu, 15 Feb 2007)
Log Message:
-----------
Improve test code
Modified Paths:
--------------
trunk/fork/tests/test_many_fork.R
Modified: trunk/fork/tests/test_many_fork.R
===================================================================
--- trunk/fork/tests/test_many_fork.R 2007-02-15 18:25:30 UTC (rev 1054)
+++ trunk/fork/tests/test_many_fork.R 2007-02-15 18:40:06 UTC (rev 1055)
@@ -6,15 +6,22 @@
# start signal handler
.C("R_install_sigcld_handler")
+cat("Hi from the parent process\n");
+
for(i in 1:100)
{
pid = fork(slave=NULL)
- if(pid==0) {
- cat("Hi from the child process\n"); exit()
- } else {
- cat("Hi from the parent process\n");
- }
+ if(pid==0)
+ {
+ cat("Hi from child process",getpid(),".\n");
+ Sys.sleep(10);
+ cat("Bye from child process",getpid(),".\n");
+ exit()
+ }
}
+Sys.sleep(300)
+cat("Bye from the parent process",pid,".\n");
+
# remove signal handler
.C("R_restore_sigcld_handler")
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|