tezvyn:

Goroutines and channels versus ownership-based concurrency

Source: interviewintermediate

WHAT IT TESTS: understanding of two concurrency philosophies. OUTLINE: Go uses cheap goroutines and CSP-style channels to coordinate by communication; Rust uses ownership plus Send/Sync to make data races a compile error.

WHAT IT TESTS: whether you can contrast a CSP runtime model with a type-system model and state precisely what each prevents. ANSWER OUTLINE: Go provides lightweight goroutines scheduled by its runtime and channels for communication, embracing 'do not communicate by sharing memory; share memory by communicating' but it does not statically prevent data races. Rust uses ownership, borrowing, and the Send and Sync marker traits to reject unsynchronized shared mutable access at compile time.

Read the original → interview

Get five bites like this every day.

Tezvyn delivers a daily feed of 60-second tech bites with quizzes to lock in what you learn.

Goroutines and channels versus ownership-based concurrency · Tezvyn