Resource management
-
Hello,
Does anybody know if there is a good library or document about how to manage resources in C++?
I am developing something similar to how DirectX manages its resources, where you Lock the resource to get access to it, read or write it, and then you Release the resource.
What I am trying to do is to have something like LockWrite and LockRead. This way the owner of the resource can LockWrite to it, write, and then ReleaseWrite it. Clients will do LockRead, read, and then ReleaseRead.
Many clients can read the resource at the same time, but to write to the resource the owner has to wait that nobody is reading the resource.
Does anybody know where to find some samples similar to this?
Thank you!
-
Hi,
From a Qt point of your are you thinking about something like:
"QMutex":http://doc.qt.io/qt-5/qmutex.html
"QMutexLocker":http://doc.qt.io/qt-5/qmutexlocker.html
"QReadWriteLock":http://doc.qt.io/qt-5/qreadwritelock.html
"QSemaphore":http://doc.qt.io/qt-5/qsemaphore.html
and friends ?