Re: Open Transport and MultiProcessing Services
Re: Open Transport and MultiProcessing Services
- Subject: Re: Open Transport and MultiProcessing Services
- From: Quinn <email@hidden>
- Date: Tue, 18 May 2004 22:11:41 +0100
At 23:39 +0400 18/5/04, Igor garnov wrote:
Can I use Open Transport in synchronous mode in MP tasks?
OTMP will allow you to use OT is synchronous mode in an MP task.
<
http://developer.apple.com/samplecode/OTMP/OTMP.html>
However, I think you meant "asynchronous mode" in the above
paragraph. That answer is somewhat complex. On Mac OS X Carbon
'interrupts' are delivered by pthreads. MP tasks are pthreads.
Thus, under Mac OS X, you shouldn't have a problem. The OT
compatibility library can't really tell the difference between your
MP task and a Carbon 'interrupt' handler.
On traditional Mac OS things a very different. You are not allowed
to call OT directly from an MP task. It's not supported and, in the
majority of cases, it will crash.
The workaround (at least for Mac OS 9 and higher, except Mac OS 9.1
of course, where MPRemoteCall is horribly broken) is to have your MP
code use MPRemoteCall with the kMPInterruptRemoteContext flag to post
work for your Blue code to do. That's basically how OTMP works.
Take a look at the documentation that comes with the sample. It's
fully of interesting goodies.
Reworking OTMP to support asynchronous notifiers would be, shall we
say, challenging. It's not something I'd approach lightly. However,
given that you actually /like/ asynchronous notifiers (most folks
spend their life cursing them), you might enjoy it.
S+E
--
Quinn "The Eskimo!" <
http://www.apple.com/developer/>
Apple Developer Technical Support * Networking, Communications, Hardware
_______________________________________________
macnetworkprog mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/macnetworkprog
Do not post admin requests to the list. They will be ignored.