Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Design Patterns for Concurrent Programming? [closed]

Which are the most relevant design patterns for concurrency-oriented programming languages?

like image 784
firefox784 Avatar asked Jan 23 '10 03:01

firefox784


People also ask

What is a concurrency design pattern?

In software engineering, concurrency patterns are those types of design patterns that deal with the multi-threaded programming paradigm. Examples of this class of patterns include: Active Object. Balking pattern. Barrier.

How do you handle concurrency in system design?

In a single-core environment, concurrency is achieved via a process called context-switching. If it's a multi-core environment, concurrency can be achieved through parallelism. Parallelism is concerned with utilizing multiple processors/cores to perform two or more tasks simultaneously.

What are the issues in concurrent programming?

Concurrency results in resource sharing, which causes issues like deadlocks and resource scarcity. It aids with techniques such as process coordination, memory allocation, and execution schedule to maximize throughput.

What are the major concurrent programming methods?

There are two common models for concurrent programming: shared memory and message passing. Shared memory. In the shared memory model of concurrency, concurrent modules interact by reading and writing shared objects in memory.


1 Answers

The most common design pattern used in concurrent programming is probably producer/consumer. There are always lots of issues and difficulties with concurrent programming, especially when starting out, like understand exactly what locking does, understanding when you need locking, understanding how to avoid deadlocks, understanding the performance implications of concurrency, and such.

Do as much research and testing as possible when working with concurrent development and code reviews are even more important than normal.

The other thing to keep in mind is it's also much better to take advantage of work others have already done and proven to be successful--use classes and frameworks available in the framework you use and those available on the net.

like image 117
Samuel Neff Avatar answered Sep 28 '22 16:09

Samuel Neff