简体   繁体   中英

threads calling other programs

I recently worked on two things : receiving data from the serial port (TinyOS and seriallisten) and capturing frames from a webcam (OpenCV). Now I want to use both together. I want to use modify the video quality according to the rssi received on the serial port.

I've been told that I can create a program which creates thread that would call the methods I previously used : camcapture.c and seriallisten.c, but I don't know how to do this.

Can someone explain it ?

Thanks

You should look int Boost Threads. There are examples on the web on how to create a program and use Boost Threads to call either a class method or a non-class static method.

About using C++ library in C code, this stackoverflow post may be helpful. I guess using extern scope operator is the magic here. C++ cross-compiler is designed using C, so backward conversion is not impossible.

If you hit success in using C++ into C Wikipedia listed these for Multithreading libraries for C++. I guess it is worth visiting those and see what is good. Boost is still the best IMPO.

PS You should checkout intel's Threading Building Block TBB too. They are quite good and simple. Open source projects such as OpenCV uses tbb for their multithreaded class ops. the link is here

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM