thread safety - Accessing the same variable from multiple tasks -
is required use locks (or mutex) access same (global) variables different tasks (coroutines) in julia?
the julia document specifies corutines use same thread:
produce() , consume() not launch threads can run on separate cpus. true kernel threads discussed under topic of parallel computing.
in case, need consider race condition between different coroutines while accessing value of global variables in different async tasks? julia scheduler have atomic operation characteristics on single assignment/access operations?
from documentation
parallel programming in julia built on 2 primitives: remote references , remote calls
in other words, it's not julistic program using locks, fetching values , remote calling.
see fetch()
, @spawnat
example provided in docs (link). can parallel examples in online repositories (such this).
Comments
Post a Comment