Skip to content

Add isFork() #18

Closed
Closed

Description

@HenrikBengtsson

From futureverse/future#224 (comment), in a question on how to detect whether or not R runs in a forked process:

> parallel:::isChild()
[1] FALSE

> f <- parallel::mcparallel(parallel:::isChild())
> parallel::mccollect(f)
[[1]]
[1] TRUE

> cl <- parallel::makeForkCluster(1L)
> parallel::clusterEvalQ(cl, { parallel:::isChild() })
[[1]]
[1] TRUE

> cl <- parallel::makePSOCKcluster(1L)
> parallel::clusterEvalQ(cl, { parallel:::isChild() })
[[1]]
[1] FALSE

Activity

  1. added
    enhancement
    on Oct 20, 2020
  2. changed the title [-]Export parallel:::isChild()[/-] [+]Add isForked()[/+] on Oct 21, 2020
  3. changed the title [-]Add isForked()[/-] [+]Add isFork()[/+] on Oct 21, 2020
  4. added this to the Next release milestone on Aug 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementfeature/resources

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions