On Thu, Nov 9, 2017 at 1:43 AM, William Dunlap via R-devel
wrote:
> I was looking at the CRAN package 'bfork-0.1.2', which exposes the Unix
> fork() and waitpid() calls at the R code level, and noticed that the help
> file example for bfork::fork removes R's temporary directory, the value of
> tem
Please note there is parallel::mcparallel/mccollect in R which provides
similar functionality, mcparallel starts a new job and mccollect allows
to wait for it.
You are right about _exit, but there are additional issues which cannot
be solved independently in an external package, and, such a lo
> tempdir(). I think it happens because the forked process shares the
> value of tempdir() with the parent process and removes it when it
> exits.
This is very likely the case. Pretty much the entire library can be
summed up by bfork_fork, which is the following.
SEXP res;
pid_t pid;
I think recreating tempdir() is ok in an emergency situation, but package
code
should not be removing tempdir() - it may contain important information.
Bill Dunlap
TIBCO Software
wdunlap tibco.com
On Wed, Nov 8, 2017 at 4:55 PM, Henrik Bengtsson wrote:
> Related to this problem - from R-devel N
Related to this problem - from R-devel NEWS
(https://cran.r-project.org/doc/manuals/r-devel/NEWS.html):
* tempdir(check = TRUE) recreates the tmpdir() if it is no longer
valid (e.g. because some other process has cleaned up the ‘/tmp’
directory).
Not sure if there's a plan to make check = TRUE th
I was looking at the CRAN package 'bfork-0.1.2', which exposes the Unix
fork() and waitpid() calls at the R code level, and noticed that the help
file example for bfork::fork removes R's temporary directory, the value of
tempdir(). I think it happens because the forked process shares the value
of