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 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: 680
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: Mon May 13 22:32:49 CEST 2024

Total time taken to generate the page: 0.01904 seconds