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 » Use same variable in different threads
Re: Use same variable in different threads [message #30173 is a reply to message #30167] Mon, 13 December 2010 11:46 Go to previous messageGo to previous message
gprentice is currently offline  gprentice
Messages: 260
Registered: November 2005
Location: New Zealand
Experienced Member
I'm guessing that if you have one thread writing to shared data and another thread reading the shared data (no writing), both threads have to acquire the mutex before accessing the data - even a thread that's only reading. There are ways of organizing things so that multiple threads can have read access to the data at the same time, instead of all blocking each other.

http://en.wikipedia.org/wiki/Readers-writers_problem

Graeme

Edit - oops, I didn't see tojocky's post before I wrote mine but it looks like we're on the same subject.

[Updated on: Mon, 13 December 2010 11:48]

Report message to a moderator

 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
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: OpenMP
Next Topic: Different native pthread.h implementations
Goto Forum:
  


Current Time: Thu May 09 12:58:08 CEST 2024

Total time taken to generate the page: 0.01689 seconds