Previous | Next --- Slide 41 of 57
Back to Lecture Thumbnails

I have a question about implementing shared address space abstraction via software solution.

Why do we mark all pages with shared variables as invalid? I do not understand...


If the hardware doesn't provide shared address spaces, then the OS needs to simulate it, so it needs to be able to intercept memory requests. If pages holding shared variables are marked invalid, then any read from/write to such a page will drop the reader/writer into kernel code (specifically, the page fault handler, as the slide says), so the OS can do the right thing.


Could someone elaborate on the system of message passing abstractions using shared memory space implementation?

What exactly does it mean to "copy memory from message library buffers" when sending messages?


@MuscleNerd: The grammar could be better. It should read: "copying from memory to message library buffers".

Imagine you had two threads running on the same machine, and we wanted a program that communicated in the message passing style. There's nothing preventing the implementation of "send process 1 variable X as message to thread 2" to be: copy X into a shared buffer. And there's nothing preventing thread 2's corresponding "recv message from thread 1 and store as variable Y" to be implemented as: copy the contents of the buffer into Y.