I am a newbie in concurrent programming in C++ I want to code a server( on a linux box ) based on the thread pool pattern where threads need to read ( and only read ) from a shared memory to answer incoming requests
I am very confused :( I wonder if something needs to be done to synchronize threads when they access the read only memory and how to do it ( using memory map file maybe ? )
If the data is read-only then you don't need to synchronize the reading threads, you only do that if something is writing. Also, threads share their parent's memory space so you don't need to make a shared memory segment or anything like that.
http://en.wikipedia.org/wiki/Thread_safety
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With