win32 critical sections vs mutexes
Lisa S. Avila
lisa.avila at kitware.com
Fri Mar 17 23:36:52 EST 2000
Hi Chris,
Maybe you can have a vtkCriticalSectionLock (or whatever you name it)
rather than creating a Win32 specific class. For now, just use the same
code from the vtkMutexLock for everything but Win32. This way someone can
use this class an still write portable code. Maybe there are lighter weight
ways of doing this on other platforms as well...
Lisa
At 05:30 PM 3/17/00, Volpe, Christopher R (CRD) wrote:
>Folks-
> In Win32, thread synchronization can be done with either "mutexes" or
> "critical section" objects
>(among other things, less relevant here). Mutexes are very expensive (600
>clock cycle minimum access
>time) but have the advantage that a given mutex can be accessed by the
>threads of different
>processes. A "critical section" object is much lighter weight but can only
>be used by the threads
>within a single process.
> The vtkMutexLock object uses Win32 mutexes. I'm wondering if anybody is
> relying on the
>inter-process (as opposed to merely inTRA-process-inter-thread)
>capabilities here. If not, I'd like
>to change the implementation of vtkMutexLock here for performance reasons.
>If vtkMutexLock must
>remain as-is for whatever reason, I'd be happy to write a
>vtkWin32CriticalSection object, but I'd
>also like to modify vtkTimeStamp to use this (on Win32 only, of course)
>for synchronizing access to
>the mtime counter.
>
>Comments, anyone?
>
>BTW, is the vtkdevelop list defunct?)
>
>Chris
>
>________________________________________
>Christopher R. Volpe
>Computer Scientist
>Computer Graphics & Systems Program
>GE Corporate Research & Development
>Bldg KW, Room C215
>P.O. Box 8, Schenectady, NY 12301
>
>(518) 387-7766, Dial Comm: 8*833-7766, Fax: (518) 387-6981
>e-mail: volpecr at crd.ge.com web: http://www.crd.ge.com/~volpecr
>
>
>--------------------------------------------------------------------
>This is the private VTK discussion list. Please keep messages on-topic.
>Check the FAQ at: <http://public.kitware.com/cgi-bin/vtkfaq>
>To UNSUBSCRIBE, send message body containing "unsubscribe vtkusers" to
><majordomo at public.kitware.com>. For help, send message body containing
>"info vtkusers" to the same address.
>--------------------------------------------------------------------
--------------------------------------------------------------------
This is the private VTK discussion list. Please keep messages on-topic.
Check the FAQ at: <http://public.kitware.com/cgi-bin/vtkfaq>
To UNSUBSCRIBE, send message body containing "unsubscribe vtkusers" to
<majordomo at public.kitware.com>. For help, send message body containing
"info vtkusers" to the same address.
--------------------------------------------------------------------
More information about the vtkusers
mailing list