Diferente pentru blog/counter intre reviziile #12 si #5

Nu exista diferente intre titluri.

Diferente intre continut:

What's the minimum value this Python code can print:
What's the minimum value this code can print:
== code(python) |
== code(c) |
import threading
num_threads = 5
print counter
==
The fact that the code is in Python doesn't really matter. Basically you're given 5 threads that each increment an integer variable _counter_ exactly 10 times. The variable isn't guarded by any lock. You can assume that reads and writes to the variable are atomic operations. What's the minimum value the counter can have after all threads finished.
Basically you're given 5 5 threads that each increment an integer counter variable exactly 10 times. The variable isn't guarded by any lock. You can assume that reading and writing to the variable are atomic operations. What's the minimum value the counter can have after all threads finished.

Diferente intre securitate:

protected
private

Diferente intre topic forum:

8263