Chapter 7 - Synchronization Examples Flashcards

1
Q

What are some problems of process synchronization?

A

Classic problems of process synchronization inlcude the bounded-buffer, readers-writers, and dining-philosophers problems. Solutions to these problems can be developed using tools such as: mutex locks, semaphores, monitors, and condition variables.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What does Windows use to implement process synchronization tools?

A

Windows uses dispatcher objects as well as events to implement process synchronization tools.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What does Linux use to protect against race conditions?

A

Linux uses a variety of approaches to protect against race conditions, including atomic variables, spinlocks, and mutex locks.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What does the POSIX API provide?

A

The POSIX API provides mutex locks, semaphores, and condition variables. POSIX provides two forms of semaphores: named and unnamed. Several unrelated processes can easily access the same named semaphore by simply referring to its name. Unnamed semaphores cannot be shared as easily, and require placing the semaphore in a region of shared memory.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What are some synchronization tools of Java?

A

Java has a rich library and API for synchronization. Available tools include monitors (which are provided at the language level) as well as reentrant locks, semaphores, and condition variables (which are supported by the API).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What are some alternative approaches to solving the critical-section problem?

A

Alternative approaches to solving the critical-section problem include transactional memory, OpenMP, and functional languages. Functional languages are particularly intriguing, as they offer a different programming paradigm from procedural languages. Unlike procedural languages, functional languages do not maintain state and therefore are generally immune from race conditions and critical sections.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly