- #1
tmt1
- 234
- 0
I was just thinking of the first concurrency problem I encountered whereby you have multiple threads incrementing a shared variable ('int x').
Now, I understand the problem and how it is solved, but since int x is a shared resource only one thread can access it at a time, so no time at all is saved. So all the concurrency problems for shared resources won't save time they will just allow concurrent tasks, whereas you can save time by increasing the number of tasks for non-shared resources?
Now, I understand the problem and how it is solved, but since int x is a shared resource only one thread can access it at a time, so no time at all is saved. So all the concurrency problems for shared resources won't save time they will just allow concurrent tasks, whereas you can save time by increasing the number of tasks for non-shared resources?