quote:
How useful would you find a string class or a linked list class that carried around a mutex that needed to be locked for every operation?
Very useful if I was sharing the string between processes, otherwise I'd wonder why they didn't use a critical section.
Actually it's kind of depressing to see people refer to strict Microsoft naming of MT primitives. I would say that mutex (MUTually EXclusive) is a wide concept including MS critical sections, MS mutex objects and MS semaphores. In other words critical sections are (a sort of) mutexes. And actually when reading a book strictly on concurrent programming, it would probably refer to them all as semaphores. So I wouldn't be to nit-picky about exact names...
![](wink.gif)
quote:
But it's worse than that. If you pass a CWnd* from one thread to another, the second thread will not have access to the msg map for the WndProc... I'm not entirely certain what all the issues are, and they are notably evasive in the MSDN docs.
All I know is that I got a ton of assertion failures & crashesCan can work around it; you have to construct your CWnd in each thread you want to use it in from the native HWND. But then you're mutli-threading with Win32 handles not MFC objects.
If the only threading issue with MFC was a simple EnterCriticalSection(csMFC), it wouldn't be a big deal...
I'd say it's a big design-flaw in the code if you have more than one thread doing GUI-work.
Edited by - amag on February 8, 2001 9:37:30 AM