Summary
This lesson summarizes the concepts covered in this chapter.
We'll cover the following
Chapter summary
-
When threads do not depend on other threads, parallelism is preferred. Consider concurrency only when threads depend on operations of other threads.
-
Because concurrency by data sharing is hard to implement correctly, favor concurrency by message passing; this is the subject of this chapter.
-
spawn()
andspawnLinked()
start threads. -
thisTid
is the thread id of the current thread. -
ownerTid
is the thread id of the owner of the current thread. -
send()
andprioritySend()
send messages. -
receiveOnly()
,receive()
, andreceiveTimeout()
wait for messages. -
Variant matches any type of message.
-
setMaxMailboxSize()
limits the size of mailboxes. -
register()
,unregister()
, andlocate()
allow referring to threads by name. -
Exceptions may be thrown during message passing:
MessageMismatch
,OwnerTerminated
,LinkTerminated
,MailboxFull
, andPriorityMessageException
.
Get hands-on with 1400+ tech skills courses.