- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Is this true?
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Yes, TBB::mutex object uses Enter|LeaveCriticalSection in the Windows implementation and pthread_mutex_lock|unlock otherwise. Each of these are meant to operate within a process, avoiding the overhead incurred for interprocess communication.
So what about shared DLLs? While the "text" of a shared DLL (the instructions and constants parts) are shared among processes, the "data" part is not. Each belongs to the respective process. In fact, you have to go to some extremesto share memory between multiple instantiations of a DLL. It's possible and there certainly are DLLs out there that use shared memory to moderate communications between multiple processes, but this is not the norm.
So, if you use tbb::mutex in a DLL that only uses parent process data, you should not have to worry about thread safety issues using tbb::mutex. But if you're DLL is moderating between multiple processes, the data structures involved will need stronger (slower) protections.

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page