15 - Quiz¶
-
Your name:
-
Your VT email:
Which of the following is a common consequence of race conditions?
- A. Programs always crash immediately
- B. Programs produce incorrect results only under certain execution orders
- C. Programs cannot compile
- D. Programs run slower but still produce correct results
What does Go's principle (given below) encourage programmers to do?
"Don't communicate by sharing memory; instead, share memory by communicating."
- A. Prevent goroutines from accessing memory entirely
- B. Use channels to exchange data between goroutines instead of sharing variables directly
- C. Use mutexes to protect all shared variables
- D. Run all goroutines sequentially
What is a channel in Go?
- A. A special type of goroutine used for synchronization
- B. A data structure that allows safe communication between goroutines
- C. A memory buffer shared by all goroutines
- D. A function that schedules goroutines
Why are unbuffered channels considered a synchronization point?
- A. They automatically order goroutines
- B. They require a sender and receiver to meet before communication occurs
- C. They allow multiple goroutines to modify shared variables
- D. They prevent goroutines from running concurrently