Skip navigation.
 
mlRe: Threading - How its done?
FROM : Scott Ribe
DATE : Thu May 08 17:33:50 2008

> What is sounds like you're saying is something like:


No, not exactly, because you know that str is constant and its value is set
at load time, so multiple readers without locks will be safe.

However, what he was responding to was much more broad, and not correct:

> Now if two threads are just reading the same piece of data it's ok
> for them to do so at the same time,


When was the data written? Unless you're dealing with const data, then you
still require synchronization primitives ON THE READS, to make sure that the
cache of the processor executing the reads is refreshed from main memory as
needed. Unless, of course, you know the exact details of the processor
you're running on and that this is not necessary.

--
Scott Ribe
<email_removed>
http://www.killerbytes.com/
(303) 722-0567 voice

Related mailsAuthorDate
mlRE: Threading - How its done? Karl von Moller May 6, 04:17
mlRe: Threading - How its done? John Calhoun May 6, 04:35
mlRe: Threading - How its done? Michael Vannorsdel May 6, 06:28
mlRe: Threading - How its done? Karl von Moller May 6, 06:46
mlRe: Threading - How its done? Michael Vannorsdel May 6, 07:12
mlRe: Threading - How its done? Karl von Moller May 6, 08:07
mlRe: Threading - How its done? Michael Vannorsdel May 6, 12:19
mlRe: Threading - How its done? Karl von Moller May 6, 13:04
mlRe: Threading - How its done? Michael Vannorsdel May 6, 13:10
mlRe: Threading - How its done? Karl von Moller May 6, 13:19
mlRe: Threading - How its done? Michael Vannorsdel May 6, 14:00
mlRe: Threading - How its done? Karl von Moller May 6, 15:25
mlRe: Threading - How its done? Michael Vannorsdel May 6, 16:52
mlRe: Threading - How its done? Michael Ash May 6, 18:34
mlRe: Threading - How its done? Chris Hanson May 8, 07:26
mlRe: Threading - How its done? Michael Vannorsdel May 8, 08:20
mlRe: Threading - How its done? Chris Hanson May 8, 08:45
mlRe: Threading - How its done? Michael Vannorsdel May 8, 09:16
mlRe: Threading - How its done? Scott Ribe May 8, 17:33
mlRe: Threading - How its done? Michael Vannorsdel May 9, 04:49
mlRe: Threading - How its done? Timothy Reaves May 9, 17:49