Closed dipterix closed 3 years ago
I guess this is an issue where the later autorun is shutdown by forked process, because when shutdown fork, later never gets resumed. This could potentially break the packages depending on later
's auto-run feature because anyone can create pthreads using packages like parallel
, future
, or multicore
and potentially disable the auto-run.
I found this trick used by fst
to detect if forked process is spawned to avoid OpenMP from running. I was wondering how hard it will be to disable auto-run when a pthread is created?
In this way auto-run never gets shut down by a pthread.
If I had to guess, I think that it's probably related to the file descriptors and input handler stuff in https://github.com/r-lib/later/blob/master/src/later_posix.cpp.
An example:
I know forked process is discouraged, but under some situation, forked process can disable
later
from auto-run. Is there any suggestions on how should I re-instantiate global loop?I tried
later:::ensureInitialized()
, but not worked.