3 ms·
There is no memory protection - all threads of a process share the same address space, the address space of the process.
by danbruc 12y ago
There is no memory protection - all threads of a process share the same address space, the address space of the process.
- chrisseaton 12y agoThere's seven slides titled "Memory Protection" about how he changes the permission of memory pages used by different threads. If each thread has its own heap, and can't write to the global heap, how do you communicate between threads? Through the main thread? Doesn't that create a bottleneck?
- scott_s 12y agoAs chrisseaton points out, you very much can change the permissions on a processes' memory at the page level. The mprotect system call lets you change the protection on regions of memory, but you can do fancy things by unmapping memory. A friend of mine from grad school did some really elaborate tricks related to memory protection to implement runtime systems for speculation ("Exploiting Coarse-Grain Speculative Parallelism", http://www.haripyla.com/wordpress/wp-content/uploads/2012/11/OOPSLA_2011.pdf http://www.haripyla.com/wordpress/wp-content/uploads/2012/11...) and deadlock elimination (see chapters 2 and 3 of his dissertation, "Safe Concurrent Programming and Execution", http://vtechworks.lib.vt.edu/bitstream/handle/10919/19276/Pyla_HK_D_2013.pdf?sequence=1 http://vtechworks.lib.vt.edu/bitstream/handle/10919/19276/Py...).
- trentnelson 12y agoQuickly scanned both those papers -- they look very interesting, I look forward to reading both in detail.
- scott_s 12y agoThe source code is available on his website: http://www.haripyla.com/research/ http://www.haripyla.com/research/ There's also a journal article under submission which is a more consumable version of his dissertation work: http://www.haripyla.com/wordpress/wp-content/uploads/2012/11/TOPLAS_submission.pdf http://www.haripyla.com/wordpress/wp-content/uploads/2012/11...