
Signature
Philosophie de baignoire - consultations sur rendez-vous.
NPDS: http://newton.kallisys.net:8080/
Apache: http://www.kallisys.com/
> Concerning the MSL, I read in this group that you need to compile it with a
> proper flag because some shared accesses are not protected by a mutex by
> default for performance reasons.
That flag is on for Mach-O.
> > Could you be more precise with file i/o? For file access i use the
> > FileManager
[quoted text clipped - 9 lines]
> So you'd better check the APIs. For the File Manager and Carbon APIs, you
> can look here:
http://developer.apple.com/documentation/Carbon/Conceptual/Multitasking_Mult
> iproServ/appendixa/index.html
>
[quoted text clipped - 6 lines]
>
> Paul
If i use mutex locks to insure thread safetiness, is it enough?
> NPDS: http://newton.kallisys.net:8080/
> Apache: http://www.kallisys.com/
Paul Guyot - 18 Jul 2003 18:12 GMT
> If i use mutex locks to insure thread safetiness, is it enough?
Well, if you protect all your calls to thread unsafe routines with a mutex,
of course it is enough.
But sometimes it is easier to actually design your code in such a way that
all thread unsafe routines are only called within a single (the main)
thread.
Paul

Signature
Philosophie de baignoire - consultations sur rendez-vous.
NPDS: http://newton.kallisys.net:8080/
Apache: http://www.kallisys.com/
Thorrsten Froehlich - 18 Jul 2003 18:14 GMT
> In article (Dans l'article) <Q1ARa.42777$PD3.4407912@nnrp1.uunet.ca>,
> "Patrick Girard" <pgirard@ubisoft.qc.ca> wrote (écrivait) :
[quoted text clipped - 5 lines]
> I think I read somewhere that more and more functions were thread safe but
> Apple doesn't publish actualized lists AFAIK.
(Sorry for replying to the wrong post, but this one isn't visible in
Google yet)
Indeed, theer are many, many more functions thread safe in Carbon, and
almost all are thread-safe. The secret is gestaltMPCallableAPIsAttr
attribute gestaltMPTrapCalls. It isn't really documented, but below is
what I got when asking on the Apple carbon-development mailing list.
I would suggest to ask there specifically about Mac OS X, and maybe
you get an answer that helps. BTW, note that some newer gestalts
don't seem to exist in all versions of Mac OS X but some of Mac OS
9/Carbon, so checking this particular gestalt may not work as expected
- in any case, I never tried checking it under Mac OS X so far...
Thorsten
>From: George Warner <geowar@snip>
>To: <carbon-development@snip>
[quoted text clipped - 5 lines]
>> I noticed that for gestaltMPCallableAPIsAttr the attribute
>> gestaltMPTrapCalls is set on Mac OS 9.2.2 (CarbonLib 1.5).
According to the
>> "documentation", the Gestalt.h header file to be precise,
gestaltMPTrapCalls
>> is "True if most trap-based calls can be made from MPTasks".
>>
>> Does this imply most of the toolbox? The term "trap-based calls"
makes
>> sense to me only in the context of the 68K toolbox which used
traps, so I am
>> a bit confused about the true meaning in this context.
Unfortunately there
>> is no further documentation available about gestaltMPTrapCalls...
>
[quoted text clipped - 15 lines]
> Mixed Mode Magic Fragment Scientist
> Apple Developer Technical Support (DTS)