How long do we have to (mutex) lock Valentina operations for Mac OS X thread-safety?

Totte Alm totte at code66.se
Wed Aug 6 08:43:42 CDT 2003


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.

// Totte

------------------------------------------------------------------------ 
-
My monitor has a knob labeled brightness.
I turned it to the max but I still feel stupid.



More information about the Valentina mailing list