PDA

View Full Version : shared memory - the right way to do it



fearu
26th October 2011, 23:46
Hello,

Until now I have not worked with multithreading applications in Qt. I've made some searches and it looks QThread is what I need. But I need also shared memory. There are two options: QSharedMemory and QtSharedMemory, and I'd like to know the differences, and where I should use each one. It looks like both have lock methods, so I won't need semaphores. The thing that surprises me is that there are thread semaphores and process semaphores, so if you don't have more than one process you can use the lighter thread semaphores, but both qsharedmemory and qtsharedmemory work with process, so it doesn't look like one of them is lighter like in the semaphore case. Is there a lighter alternative for shared memory?