Re: Are OT calls MP safe
Re: Are OT calls MP safe
- Subject: Re: Are OT calls MP safe
- From: Quinn <email@hidden>
- Date: Fri, 14 Feb 2003 09:22:41 +0000
At 17:52 +0000 12/2/03, Mark Thomas wrote:
Does any know if the OT calls are MP Task safe (i.e. To call within a MP
task), taking into consideration that each MP Task, will just operate on a
single EndpointRef, using OTSndUData.
Look at DTS Tecnote 2006 "MP-Safe Routines".
<
http://developer.apple.com/technotes/tn/tn2006.html>
Tables 1 through 11 list the OT routines that are MP safe without
OTMP. Table 12 lists the routines for which OTMP provides an MP safe
equivalent.
The fact that you're using a single endpoint per MP task has no
bearing on whether a routine is MP safe. The unsafe routine are
unsafe to call from MP, period (primarily because they might execute
68K instructions, which are unsafe).
I have found these OTMP code, which seem to give the impression if this
will work for for me so I can use them in MP Tasks, but confused a little.
1) Do I need to convert my InitOpenTransportInContext to
InitOpenTransportMPXInContext in the main application code (i.e. The code
which works within the blue process), or do I need to calls this per MP Task
You need to do this once per OT context that you wish to create. DTS
Technote 1173 "Understanding Open Transport Asset Management"
describes the concept of OT context's in laborious detail. However,
most applications only need one per context.
<
http://developer.apple.com/technotes/tn/tn1173.html>
Note that you must call InitOpenTransportMP[X]InContext at system task time.
2) Code which works within the blue process of the application can remain as
it is, using OTxxxxxxx calls
Yes. If you want to use OT and OTMP calls in the same process, you
probably should create two contexts, one via
InitOpenTransportInContext and one via
InitOpenTransportMP[X]InContext. You could also arrange to share the
context between OT and OTMP; that would require (trivial)
modification of OTMP.
2) In All my MP tasks, I just use the OTMPXxxxxx calls although it looks
like some calls need to change e.g.
endPoint = OTOpenEndpointInContext( OTCreateConfiguration(kUDPName), 0, nil,
&err, NULL);
To
endPoint = OTMPXOpenEndpointQInContext( kUDPName, 0, nil, &err, NULL);
Yep. That change is specifically called out in the comments in "OTMP.h".
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.