CSC 456 Fall 2013/7a ac: Difference between revisions

From Expertiza_Wiki
Jump to navigation Jump to search
Line 98: Line 98:
|style="background:#000000"|
|style="background:#000000"|
|style="background:#ffffff"|
|style="background:#ffffff"|
|Coarray<ref name=umdguide>{{cite web|last=User Education Services|title=Primary, Secondary and Tertiary Sources guide|url=http://www.lib.umd.edu/ues/guides/primary-sources|publisher=University of Maryland Libraries|accessdate=12 July 2013}}</ref>
|Coarray<ref name=umdguide>{{cite web|url=http://www.co-array.org|accessdate=12 November 2013}}</ref>
|}
|}



Revision as of 17:21, 12 November 2013

Survey of Primitives for Synchronization

Assignment

7a. Survey of primitives for synchronization Section 7.3 of Solihin covers the need for synchronization at the program level. It mentions lock and unlock operations. But real programs do not usually call lock and unlock mechanisms. Instead, they use higher-level operations, such as Java’s synchronized statement, or Open MP pragmas. Consider popular languages and common OSs such as Linux, MacOS, and Windows. How would programs do synchronization in these environments?

Ideas

synchronization constucts

syncs in clr semaphores in monitors (how many langs available in?)

Different Synchronization Constructs, languages that support them, general info.

Test-and-Set

Test-and-Test-and-Set

Lock-free

Array-lock


Semaphore-Java, C Acquire/Release the semaphore to enter the critical section. Only 1 thread can have the semaphore at a time.

Mutex-Java, C Like a binary semaphore, but with a few differences such as deletion safety (a process holding a mutex cannot be deleted).

Monitor-Java, C

Synchronized-Java

pragma-C (OpenMP)


a study of behavior of synchronization methods in commonly used languages and systems cederman et al.

Supported Synchronization in Different Languages

Synchronization Support
Language Semaphore/Mutex Monitor OpenMP Synchronized Other
C
Java
C++ Slim Rd/Wr Lock (SRW)
C#
Ruby Get Sources
Python Get Sources
PHP Get Sources
Fortran Coarray<ref name=umdguide></ref>

References

Cederman et al.

Apple Synchronization

C++ Sync Article