Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ MT-multithreading and servers » MT/Locking Questions
Re: MT/Locking Questions [message #15560 is a reply to message #15529] Tue, 29 April 2008 10:03 Go to previous messageGo to previous message
mr_ped is currently offline  mr_ped
Messages: 825
Registered: November 2005
Location: Czech Republic - Praha
Experienced Contributor
Well, I never did MT with U++, so I have no direct experience, but that's what makes *sense* to me.

Thinking more about it, the instantiated non-static mutex may be enough, if the multiple threads are working with the same instance of the class with the accessed static variable, but that imposes additional burden on mind of programmer, to never introduce another instance.

Anyway, a search trough files in uppsrc leads to these interesting lines:
C:\upp\uppsrc\Core\heap.cpp(115):static StaticMutex sHeapLock;
C:\upp\uppsrc\Core\Mt.cpp(9): static Mutex *section;
C:\upp\uppsrc\Draw\Draw.cpp(9):static StaticMutex sDrawLock;

As you can see, there's some StaticMutex class also. I'm looking at the source right now, but I have still no idea why ordinary Mutex would be not good enough even for static variable of class.

Sorry.
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: How to send broadcast
Next Topic: PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP not defined
Goto Forum:
  


Current Time: Sun Apr 28 20:24:47 CEST 2024

Total time taken to generate the page: 0.02433 seconds