I'm really new to Erlang and am currently having trouble writing a reader / writer program in Erlang. In principle, a shared memory location can be read by any number of tasks at the same time, but when a task should be written to a shared memory folder, it should have exclusive access. My idea would be to spawn read / write methods for different processes and in these methods just print something like "Read Reading" / "Writing".
However, using a semaphore / mutex really listened to me, and I have no background in multithreading / concurrency. Can anyone give some hints on how to write such a program?
source share