U++ framework
Do not panic. Ask here before giving up.

Home » U++ Library support » U++ MT-multithreading and servers » MT and variables simple question
Re: MT and variables simple question [message #43198 is a reply to message #43197] Thu, 05 June 2014 22:32 Go to previous messageGo to previous message
Didier is currently offline  Didier
Messages: 740
Registered: November 2008
Location: France
Contributor
Hello Koldo,

A mutex is used to protect a variable from being modified by two threads at the same time (no matter how that variable is modified).
So if you modify a variable using the var itself or a pointer to it: the result is the same ==> you have to protect the variable

If the variable is accessed by only one thread, then there is no need to use mutexes

 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: [SOLVED] Fix some memory leak in IpAddrInfo
Next Topic: [SOLVED][FeatureRequests]Use HttpRequest to upload large file
Goto Forum:
  


Current Time: Fri Jun 19 12:17:08 GMT+2 2026

Total time taken to generate the page: 0.00962 seconds