CFMessagePorts vs CFMachPorts
CFMessagePorts vs CFMachPorts
- Subject: CFMessagePorts vs CFMachPorts
- From: Richard Schmitt <email@hidden>
- Date: Wed, 17 Jun 2009 07:46:42 -0700 (PDT)
I'm porting a package that uses SYSV Message Queues to OSX/Darwin. From what I've read from various lists is that in OSX, the mechanism to use is the message ports in the core foundation, or to use the underlying mach message queues.
I'm a bit confused with the CFMessagePorts and, I suppose, the associated run loops. If I'm a server port, and get a receive callback that I suppose comes up from the run loop, I would want to reply to the message, but not right away. If my callback blocks, I believe I'd end up blocking the run loop so I'll stop receiving any other requests. This is not a behavior I want.
What I'd prefer is to have the receive callback receive requests, and trigger some processing. When the request is complete, I'd like to
simply send the response back but there doesn't seem to be any routine to send responses. I could treat everything as one direction messages but then the server would need to create remote ports for every client that may send it a request.
So maybe CFMessagePorts are not what I want to use, but rather use the underlying Mach ports. But Mach ports aren't named so I'm not so sure how the clients would find the servers. Maybe I'd use the CFDictionaries for this. This is probably a naive question. Can dictionaries be shared between processes if I access the dictionary within a shared library?
Any help (or examples) would be great.
Thanks,
Rich
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden