Implementing Streams Using C ++

I have an API call in my application where I check the time taken for one call. I put this in a FOR loop and used 10000 calls to get the average time of all calls. Now the problem is that the actual application using the API is multithreaded. If I want my application to do the same thing too, how would I do it?

REL platform and my goal is to send multiple calls at the same time with the same parameters or different parameters. Could this be implemented in C ++, and if so, which library should I use and could there be an example for this?

0


source to share


7 replies


Probably the best C ++ library for streaming is the threading library in Boost, but like all C ++ threads, you will be forced to manually do your synchronization. You will need to use mutexes and locks for them to work properly. Your question is not very clear, so I can’t help you anymore (although I think you don’t actually need threads, but I may be completely incomprehensible).



+7


source


If you are reading the Miranda IM source code, you need to get started. It's very well done, and there are some helpful hints in the code on how to overload the memory offsets of other executables (on Windows) so they load faster.



http://www.miranda-im.org/development/

+1


source


I don't know the REL platform.

I can suggest an alternative to OMP, it's not exactly Threads per say, but it does the job and is pretty easy to use for this kind of scenario. Apparently it works for pretty compilers .

+1


source


Which platform? Almost everyone supports streams, and I think they have documentation on how to create a stream. On Windows, the CreateThread API is called.

0


source


Pthreads is how you would do it with Linux. Solaris Threads for Solaris.

0


source


I am not familiar with the REL platform. In general, I prefer Intel TBB for streaming, but it only works on x86 chips right now.

0


source


With C ++ 11, you no longer need to use Boost. C ++ 11 includes std::thread

supporting mutexes, condition variables, and so on very much like Boost does.

You can take a look at what C ++ 11 offers in terms of streaming in the C ++ reference .

0


source







All Articles