Hello,
I have been working on an OpenCV project that uses the grand central dispatch pattern, libdispatch. I have asked at both the OpenCV forum and lisdispatch forum, but sources said that this is a more general C++ issue.
http://opencv.org/
http://opensource.mlba-team.de/xdispatch/docs/current/index.html
Anyway, i've made a neat little application that does image processing. Libdispatch has a series a of task queues that can recieve new data and perform a task.
What are the correct ways to count memory? Let's say we have 2 users each running a task queue. One user has paid to have 2Gb of RAM available to them at any one time. The other, has 4Gb. How can i count the memory between threads?
I am thinking along two lines... but, the issue arises of how to manage and control at this level with C++.
1) Do i mark each task type with some or of multiplier. i.e. Convertcolour uses X memory, and i want to convert and image. image size * cost per task.
2) Continually check how much memory has been allocated so far.
Basically i want to create a paid image processing service, that does not expand beyond the capacity that has been paid for.
Any clever ideas for this?
Regards,
Daniel
Visual Studio 2012
OpenCV
xDispatch