How to simultaneously run two loops?
1 view (last 30 days)
Show older comments
Hi,
I am trying to perform two image processing tasks simultaneously: 1. Get data from webcam and use it to record a video. 2. Get intermittent snapshots from the same webcam, do some data processing on the images
I basically want the video recording function to go independently with the data processing. The data processing takes some time to perform. So when I try to capture video using snapshots, I get the timing of video wrong if I am doing both in the same loop.
I have an 8 core processor. Is it possible to multithread the program in some way, so that I could run the processes independently?
Please help. Thanks in advance,
Ashwin
0 Comments
Answers (1)
Guillaume
on 24 Dec 2014
Core matlab is single threaded without any option for multithreading.
It may be possible to do what you want with the parallel computing toolbox. I don't have this toolbox so can't help you with it.
Other options is to defer the processing to a later time, reduce the time the processing takes (the parallel computing toolbox can help with this as well), or use another language to manage the jobs. On windows, .Net has excellent support for multithreading and you can call matlab function from it.
See Also
Categories
Find more on Startup and Shutdown in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!