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

[wip] support using tasks on threads (2/3) #30838

Merged
merged 1 commit into from
Mar 18, 2019
Merged

Conversation

vtjnash
Copy link
Sponsor Member

@vtjnash vtjnash commented Jan 25, 2019

Thread-safety for Workqueue, permit interacting with Tasks from threads

TODO:

  • merge InvasiveLinkedListSynchronized into InvasiveLinkedList

@ararslan ararslan added the domain:multithreading Base.Threads and related functionality label Jan 25, 2019
@kpamnany
Copy link
Contributor

Haha, it's good ol' task_done_hook().

You're trying to support old-style threaded loops with these multiple Workqueues? I don't really understand the why of these changes.

@vtjnash
Copy link
Sponsor Member Author

vtjnash commented Feb 15, 2019

The old Workqueue (extended here to threads) should be the same as the partr sticky queue, I'm just keeping more of the implementation in Julia here.

base/boot.jl Outdated
@@ -380,8 +380,8 @@ eval(Core, :(LineInfoNode(mod::Module, method::Symbol, file::Symbol, line::Int,

Module(name::Symbol=:anonymous, std_imports::Bool=true) = ccall(:jl_f_new_module, Ref{Module}, (Any, Bool), name, std_imports)

function Task(@nospecialize(f), reserved_stack::Int=0)
return ccall(:jl_new_task, Ref{Task}, (Any, Int), f, reserved_stack)
function Task(@nospecialize(f), reserved_stack::Int, completion_future)
Copy link
Sponsor Member

Choose a reason for hiding this comment

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

We probably don't want to expose this argument --- should either rename this method or assign the field in the other Task constructor.

@JeffBezanson JeffBezanson merged commit baf0caa into jn/task-ll Mar 18, 2019
@StefanKarpinski StefanKarpinski deleted the jn/task-thread branch March 18, 2019 21:18
JeffBezanson pushed a commit that referenced this pull request Mar 19, 2019
raphbacher pushed a commit to raphbacher/julia that referenced this pull request Mar 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
domain:multithreading Base.Threads and related functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants