Answer the question
In order to leave comments, you need to log in
What are the possible options for the simplest programs on which you can practice using mutexes, semaphores, shared memory?
Good day,
I want to deal with interprocess communication in Unix-like systems. And I would like to implement something for understanding in C ++. Could you advise me on possible variants of the simplest programs on which I would practice using mutexes, semaphores, shared memory? And some literature on this subject. I liked the article that I found on Habré .
Answer the question
In order to leave comments, you need to log in
Try to implement a multi-threaded spherical number crusher server in a vacuum. Factorization of small numbers, for example, well, or just a random delay of the order of 100-1000 ms.
Several network listener processes (each can only hold a few connections to clients), several counter processes that perform factorization, a watchdog that watches them so that no one falls inadvertently, and a daemon that starts or extinguishes everyone.
You will have shared memory to store the base of small primes, and a ring buffer to exchange between "front" and "back", and so on.
You can replace the spherical number crusher with spherical work with the database, for example, by adding an additional layer of the connection pool and the processes that serve it.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question