What is competition control?

15

About the studies I was doing the moment I asked What is a traffic light? , I was informed that , to better understand this term, I should study about Competition Control .

Could anyone explain what it is about?

    
asked by anonymous 08.06.2017 / 20:09

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 your competition (traffic light is one of them):

  • Monitor is a technique used to synchronize tasks that share a resource. that is, the monitor provides an interface to allow manipulation of a shared resource. It uses a mutually exclusive lock, which consists of control variables and rules to release or lock the resource. In practice, the monitor is basically a class that controls the resource, so when it is necessary to request it we should send the request to it.
  • Lock is a mechanism that isolates access to a resource, limiting one write access at a time. In this way, it manages a queue of accesses, that is, the first one requesting the lock gains access to the resource, and the subsequent accesses enter a queue waiting until the lock be released to be granted access to the next in line. It is widely used in databases to control access to tables and records.
  • Traffic light is a concurrency mechanism that controls the amount of concurrent 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 route. When the maximum number of available resources is reached, requests must wait for some task to be completed to access the shared resource.

Some interesting links about competition and semaphores:
link

link

link

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

    
16.06.2017 / 20:42