Skip to content

Latest commit

 

History

History

1_8_thread_safety

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

Step 1.8: Thread safety

Estimated time: 1 day

Rust has Send and Sync marker traits which are fundamental for concurrency and thread safety story in Rust and represent one of fearless concurrency corner stones (which allow to avoid data races at compile time).

For better understanding Send/Sync purpose, design, limitations and use cases, read through the following articles:

Task

Implement the following types, which meet conditions:

  1. OnlySync is Sync, but !Send.
  2. OnlySend is Send, but !Sync.
  3. SyncAndSend is both Sync and Send.
  4. NotSyncNotSend is both !Sync and !Send.

All inner details of implementation are on your choice.

Play with these types from multiple threads to see how compile time fearless concurrency works in practice.