Concurrent computing: Difference between revisions

Content deleted Content added
m Added 2 {{Bare URL inline}} tag(s) using a script. For other recently-tagged pages with bare URLs, see Category:Articles with bare URLs for citations from August 2024
m Disambiguating links to Deadlock (link changed to Deadlock (computer science)) using DisamAssist.
Line 34:
 
===Coordinating access to shared resources===
The main challenge in designing concurrent programs is [[concurrency control]]: ensuring the correct sequencing of the interactions or communications between different computational executions, and coordinating access to resources that are shared among executions.<ref name=benari2006/> Potential problems include [[Race condition#Software|race conditions]], [[Deadlock (computer science)|deadlock]]s, and [[resource starvation]]. For example, consider the following algorithm to make withdrawals from a checking account represented by the shared resource <code>balance</code>:
 
<syntaxhighlight lang="cpp" line highlight="3,5">