Ruslan Prakapchuk
Ruslan Prakapchuk

Reputation: 614

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.

Upvotes: 6

Views: 736

Answers (1)

longemen3000
longemen3000

Reputation: 1313

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

Upvotes: 1

Related Questions