Issue #14867 has been updated by Eregon (Benoit Daloze).


normalperson (Eric Wong) wrote:
> eregontp / gmail.com wrote:
>  > Would it be simpler to track a set of pids created by MJIT, ignore those in waitpid() and synchronize around both creating GCC processes and when checking the result of waitpid()?
>  
>  Not possible, if there's a thread running in waitpid(-1, 0),
>  it can steal the result of waitpid(mjit_used_by_pid).

Thank you for the reply.
I am not sure to understand why it is not possible, could you elaborate a bit more?
Could the thread running waitpid(-1, 0) then pass that wait result to the MJIT thread, and retry waitpid(-1, 0) in such a case?
(with careful synchronization as PIDs can be reused, to ensure to correctly classify as MJIT/non-MJIT pid)

----------------------------------------
Bug #14867: Process.wait can wait for MJIT compiler process
https://bugs.ruby-lang.org/issues/14867#change-72710

* Author: k0kubun (Takashi Kokubun)
* Status: Open
* Priority: Normal
* Assignee: normalperson (Eric Wong)
* Target version: 
* ruby -v: 
* Backport: 2.3: UNKNOWN, 2.4: UNKNOWN, 2.5: UNKNOWN
----------------------------------------
If Ruby tries to wait for any child process, MJIT's gcc/clang process could be caught by the method call. It's not convenient for both Ruby's user and MJIT worker thread, so Process.wait and its families should somehow avoid waiting for it.

---Files--------------------------------
0001-hijack-SIGCHLD-handler-for-internal-use.patch (13.8 KB)


-- 
https://bugs.ruby-lang.org/

Unsubscribe: <mailto:ruby-core-request / ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>