I need your help. I work on a Programm, that should grab Pictures with 25fps and edit them with 20ms per Picture. I build an example Programm for this, which go through a while loop, in a for loop( working time is about 19-20 ms, which is ok). Then i threaded the whole Thing and had to become this stable. I have to work with 12 threads at the same Time. The Problem is in my Evaluation, in 8 hours of testing i become 3-5 Values of 30-40 ms and i don't know why. I've also already tried the whole Thing with c++11 parallelized Threads and became the same Time Values. I work on a Dell Server with 2 Processors and 16 CPU's. Thank you for helping.
Asked
Active
Viewed 53 times
-3
-
Hey, welcome to Stack Overflow! I'm afraid it's difficult, if not impossible, to make suggestions on how to improve on an unseen implementation. You are going to have to expand on your question if you want meaningful responses. – user4581301 Aug 17 '16 at 07:33
-
So i have to paste the Code? – Pawlik.E Aug 17 '16 at 07:38
-
You almost always want to post code or an extremely detailed description of the algorithm that might as well be code. You don't want to post all of your code, though. You want to post a [mcve], and what you are describing will have an impressively long MCVE. – user4581301 Aug 17 '16 at 07:46
1 Answers
1
The problem here is that Windows (as well as most Linux variants) is not a real-time operating system. As such, you're not guaranteed to have consistent maximum task times. Any external input may hold down your threads for a short or longer time period. Even if you bring down your thread working time to 1-2 ms you still may experience situations with > 20 ms running time. Your solutions are: either use a real-time OS or make provisions that allow for a periodic longer delay (which is more of a design issue).

Ton Plooij
- 2,583
- 12
- 15
-
Yes, i already thought, that Windows jitter may be the cause of the Problem. I've already got a Software which could solve this(named Kithara), but at the moment they got performance issues, the whole Thing is stable, but 3 Times slower than it should be. – Pawlik.E Aug 17 '16 at 07:49
-
-
Although I have no experience with it, the [RTX Real Time Extensions for Windows](http://www.directinsight.co.uk/rtx-real-time-windows/) might be a good solution for you. Otherwise I would suggest to investigate a Linux OS like [RTLinux](https://en.wikipedia.org/wiki/RTLinux) or [ChronOS Linux](http://chronoslinux.org/wiki/Main_Page) and see which platform supports most of your required packages and/or APIs. – Ton Plooij Aug 17 '16 at 08:08
-
Perhaps this is an interesting reading on Linux RTOS development: http://stackoverflow.com/questions/29358214/what-is-the-best-way-to-start-programming-with-real-time-linux – Ton Plooij Aug 17 '16 at 08:15