Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add locks for libuv #31437

Merged
merged 1 commit into from
Mar 22, 2019
Merged

add locks for libuv #31437

merged 1 commit into from
Mar 22, 2019

Conversation

JeffBezanson
Copy link
Member

Rebased and squashed version of #29706.

@JeffBezanson JeffBezanson added io Involving the I/O subsystem: libuv, read, write, etc. multithreading Base.Threads and related functionality labels Mar 21, 2019
@JeffBezanson JeffBezanson merged commit ad40952 into master Mar 22, 2019
@JeffBezanson JeffBezanson deleted the am/libuv-lock branch March 22, 2019 17:39
if ((err = uv_pipe_init(jl_io_loop, (uv_pipe_t*)handle, 0))) {
// JL_UV_UNLOCK() equivalent is done during unwinding
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Errr, no. This is not the case for the NOGC version of the lock.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the locks here can just be removed; threads haven't been started yet at this point.

static uv_loop_t *const unused_uv_loop_arg = (uv_loop_t *)0xBAD10;

extern jl_mutex_t jl_uv_mutex;
#define JL_UV_LOCK() JL_LOCK_NOGC(&jl_uv_mutex)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Has this been tested under heavy GC to make sure that none of the locked code ever touches the GC (or better, by adding an assertion on GC entry that this lock is not held)?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, we know for a fact that we hold this lock while doing arbitrary user computation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
io Involving the I/O subsystem: libuv, read, write, etc. multithreading Base.Threads and related functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants