I'm working with Julia. The IDE is Juno.
If I'm right, @async
can generate a task, it's just like a thread.
So we can do this:
@async begin
# do something1
end
@async begin
# do something2
end
Now, I need to lock a thread. For example, do something1
is to push message to a list and do something2
is to pop message from the same list.
It's like synchronized
in Java.
what is synchronized
in julia?
To keep a block mutex:
There is also a
@sync
macro: