What is competition control?

Asked

Viewed 410 times

15

About the studies I was doing at the time I asked What is a traffic light?, informed me that, in order to better understand this term, I should study about Control of Competition.

Could someone please explain to me what this is all about?

2 answers

4


In a very simple way, competition control aims to manage access to shared resources. The goal is to control how multiple accesses can use a resource without conflicts, because concurrent access is simultaneous can generate data inconsistency.
This is not restricted to databases, but can be memory variables, physical files, threads, etc..

There are different ways to manage the competition (traffic light is one of them):

  • Monitor is a technique used to synchronize tasks that share a resource. that is, the monitor offers an interface to allow manipulation of a shared resource. To do so it uses a mutual exclusion lock, which consists of control variables and rules to release or lock the resource. In a practical way, the monitor is basically a class that controls the resource, so when we need to order it we should send the request to it.
  • Lock is a mechanism that isolates access to a resource, limiting it to one written access at a time. With this, he manages an access queue, that is, the first to request the lock gains access to the resource, and subsequent accesses queue until the lock is released to be granted access to the next row. It is widely used in databases to control access to tables and records.
  • Traffic light is a competition mechanism that controls the amount of simultaneous access to a shared resource. It would be similar to a traffic light, but not by time, but by the amount of vehicles that can access a road. When the maximum number of resources available is reached, requests must wait for a task to be completed to gain access to the shared resource.

Some interesting links about competition and traffic lights:
https://www.revista-programar.info/artigos/threads-semaforos-e-deadlocks-o-jantar-dos-filosofos/

https://brizeno.wordpress.com/tag/semaforos/

http://www.inf.ufsc.br/~Frank.Iqueira/INE5645/3. %20Controle%20de%20Concorrencia.pdf

1

Complementing the previous answer, with other words and exemplifying, is what happens on your computer: There are several programs and threads "wanting" to be run by the processor, use the cache data, the RAM memory, access I/O devices, among others. The system needs to manage this in a way that does not create confusion between information, memory addresses, or even when a program/thread enters a critical region. Prevent or free access to devices when they can be used.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.