I'm kinda confused about the idea about using ports in message passing. The wiki says that you would send messages to ports instead of the individual thread. Would each port be connected to a unique mailbox or could multiple ports refer to the same one? Does there even need to be a mailbox at all? Also, how would other threads from different processes know of the existence of ports created by servers?
PS: If anyone can point to an article or paper explaining message passing ports, it would be very much appreciated. Thanks.
Port Abstraction Questions
Re: Port Abstraction Questions
Hi,
The essential idea is sending N bytes from A to B, but what those bytes are, what range of values N can be, what A and B are (and how they are allocated, if they are allocated), how the scheduler is involved and how it is actually implemented are all things that vary significantly.
Cheers,
Brendan
IMHO this is just different terminology: port = mailbox = message exchange = something (e.g. a number) to uniquely identify where the message is being sent (and possibly, where it was sent from).deadmutex wrote:I'm kinda confused about the idea about using ports in message passing. The wiki says that you would send messages to ports instead of the individual thread. Would each port be connected to a unique mailbox or could multiple ports refer to the same one? Does there even need to be a mailbox at all?
One way is to use the (virtual) file system. For example, if you write a font engine you might create a file called "/services/my_font_engine" that contains the port/mailbox/exchange for the font engine. Alternatively the OS might have a seperate name lookup service so you can do something like "bindMessagePort(name, portNumber)" and other people can do "portNumber = findMessagePort(name)".deadmutex wrote:Also, how would other threads from different processes know of the existence of ports created by servers?
I've never seen a generic article - most articles describe how a specific form of messaging was (or could be) implemented, but don't discuss the wide variety of different ways it could be done.deadmutex wrote:PS: If anyone can point to an article or paper explaining message passing ports, it would be very much appreciated. Thanks.
The essential idea is sending N bytes from A to B, but what those bytes are, what range of values N can be, what A and B are (and how they are allocated, if they are allocated), how the scheduler is involved and how it is actually implemented are all things that vary significantly.
Cheers,
Brendan
For all things; perfection is, and will always remain, impossible to achieve in practice. However; by striving for perfection we create things that are as perfect as practically possible. Let the pursuit of perfection be our guide.