Diferente pentru blog/counter intre reviziile #2 si #3

Nu exista diferente intre titluri.

Diferente intre continut:

What's the minimum value this code can print:
Given 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.
 
In Python it would look like this:
== code(c) |
import threading
print counter
==
The puzzle asks for the minimum value this code can print.
 
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.

Nu exista diferente intre securitate.

Topicul de forum nu a fost schimbat.