How long do we have to (mutex) lock Valentina operations for
Mac OS X thread-safety?
Ruslan Zasukhin
sunshine at public.kherson.ua
Wed Aug 6 11:43:55 CDT 2003
on 8/6/03 9:43, Totte Alm at totte at code66.se wrote:
> Hello,
> onsdagen den 6 augusti 2003 kl 04.33 skrev Matthew Jew:
>
>> My question is this: What should one consider the "duration" of the
>> Valentina operation
>> that one has to lock for?
>
> I've tried to manage this, but found that making Valentina Threadsafe,
> really kills all benefits of prepemtive threads, as db.flush() needs to
> be wrapped in a mutex, which causes everything to freeze for several
> seconds if this happens in the non Main thread, and the UI needs to
> touch Valentina. My solution was to run Valentina Tasks as shelltools,
> that talks back to the Main App using AppleEvents (cound be TCP also,
> but this is a Carbon App). This way, I need no locking at all, as every
> "thread"/shelltool has its own cache.
>
> So, what I've suggested to Ruslan before is that ValentinaInit could be
> called with somekind of param, to Initialize multiple instancies of
> Caches and Globals, one for each thread.
Wait, Totte,
Cache CANNOT have several instances !!!
Otherwise this is NOT cache.
ONLY ONE.
--
Best regards,
Ruslan Zasukhin [ I feel the need...the need for speed ]
-------------------------------------------------------------
e-mail: ruslan at paradigmasoft.com
web: http://www.paradigmasoft.com
To subscribe to the Valentina mail list go to:
http://lists.macserve.net/mailman/listinfo/valentina
-------------------------------------------------------------
More information about the Valentina
mailing list