开发者

Pipes and sockets - "message passing" or "shared memory"?

Ok, this is a stupid question...

Are pipes, FIFOs, and sockets shared memory or message passing..?

At first I thought they were shared memory because pipes use read() and write(), but now I'm just totally confused. Technical开发者_如何学JAVAly the "messages" are stored in the kernal's address space, so is it a message or stored memory? I have an exam for Intro to OS's in a few hours, and I just need this cleared up. Thanks in advance!


message passing, as they require participation on both sides, sender and receiver in case of sockets for example. they can be implemented using shared memory, but communication pattern is message passing


It's message passing. You specify a buffer to write into the socket buffer, and you find out how much space it has available beforehand using getTxAvailable() or whatever. It's not really shared memory as it does a buffer blit operation to help encapsulation of the socket. If you're talking about socket on client to socket on server, that's also message passing. Something like a Java direct buffer or file-mapped memory is shared memory.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜