CSC352 Synchronization and Java Threads

From dftwiki3
Revision as of 14:10, 9 September 2013 by Thiebaut (talk | contribs) (Created page with "--~~~~ ---- <bluebox> This page treats of the concepts of synchronization of parallel programs in general, applied to the Java platform in particular. </bluebox> <br /> __TOC...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

--D. Thiebaut (talk) 14:10, 9 September 2013 (EDT)


This page treats of the concepts of synchronization of parallel programs in general, applied to the Java platform in particular.



It all starts at the Lowest Level: Assembly Language (again)

Question
What if the two threads in the ParallelPi program updated a global sum variable by doing something like this?
    sum += thread_sum;

where thread_sum is a local variable used by the thread function to accumulate the terms of the series. The actual program can be found here.