Basics of Concurrent Programming.

Concurrent work is multiple works happening at the same time.

Process is a running program.

Thread (lightweigh process, LWP) is object inside heavyweight process that has it's own control & that shares resources with other threads in the same process.

Critical section is a code section that can be accessed by only one process or thread at the same time.

critical section has uses for example in banking: we do not want data to be overwritten as it's written by other process, or read during writing.

example pseudocode:

process P;

  while true do

Source: my partial education (see: [7]), my experience.

See also: Petersen's Algorithm, Classic Concurrency Problems, Petri Nets.

No comments:

Post a Comment