Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I call function in a separate thread in Julia 0.5-dev?

I know, that native threads support in Julia is still incomplete, but I want to live on the bleeding edge. I've built master branch with JULIA_THREADS=1, and automatic multithreading with @threads works fine.

What I want is just to call my own function in a separate native thread. AFAIK jl_threading_run used by @threads doesn't suit me because it will call my function in several threads simultaneously. Of course, I can try to workaround this behaviour by checking thread number and doing work only in one of them. But I'm sure that more straight way must exist. I've skimmed through C implementation of multithreading support, but my knowledge of C and Julia internals is not enough to figure out how to complete my task.

like image 320
Ruslan Prokopchuk Avatar asked Mar 28 '16 12:03

Ruslan Prokopchuk


1 Answers

all changed with Julia 1.3, this article explains the new multithreading model of julia

like image 132
longemen3000 Avatar answered Sep 30 '22 19:09

longemen3000