Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Under the hood, you still use shared memory in this style of programming. But the programmer never uses shared memory directly. Instead he passes references to the shared memory to other threads, and the act of passing a reference clears the reference in the sending thread so the sending thread can no longer access it.

In Rust, this style is enforced by the language. In C++11 you can enforce it by the convention of using std::unique_ptr and passing those between threads via a shared data structure like a blocking queue.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: