Click here to Skip to main content
15,912,205 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Class or object? Pin
_Flaviu1-Jul-15 22:17
_Flaviu1-Jul-15 22:17 
GeneralRe: Class or object? Pin
Stefan_Lang1-Jul-15 22:36
Stefan_Lang1-Jul-15 22:36 
GeneralRe: Class or object? Pin
_Flaviu2-Jul-15 1:21
_Flaviu2-Jul-15 1:21 
AnswerRe: Class or object? Pin
Kevin McFarlane6-Jul-15 23:16
Kevin McFarlane6-Jul-15 23:16 
QuestionVery simple binary file compressor in C Pin
stonemanhero26-Jun-15 1:52
stonemanhero26-Jun-15 1:52 
AnswerRe: Very simple binary file compressor in C Pin
CPallini26-Jun-15 3:00
mveCPallini26-Jun-15 3:00 
QuestionCreating a standalone exe with Visual Studio 2013 native unit tests? Pin
Joe Woodbury25-Jun-15 10:53
professionalJoe Woodbury25-Jun-15 10:53 
SuggestionRe: Creating a standalone exe with Visual Studio 2013 native unit tests? Pin
Albert Holguin26-Jun-15 10:40
professionalAlbert Holguin26-Jun-15 10:40 
GeneralRe: Creating a standalone exe with Visual Studio 2013 native unit tests? Pin
Joe Woodbury26-Jun-15 11:15
professionalJoe Woodbury26-Jun-15 11:15 
QuestionCan resource statement CTEXT be used with CStatic Pin
ForNow24-Jun-15 9:09
ForNow24-Jun-15 9:09 
AnswerRe: Can resource statement CTEXT be used with CStatic Pin
CPallini24-Jun-15 12:09
mveCPallini24-Jun-15 12:09 
GeneralRe: Can resource statement CTEXT be used with CStatic Pin
ForNow24-Jun-15 12:44
ForNow24-Jun-15 12:44 
QuestionWindows 8.1 Event log problem Pin
zeki yugnak24-Jun-15 3:32
zeki yugnak24-Jun-15 3:32 
QuestionRe: Windows 8.1 Event log problem Pin
David Crow24-Jun-15 3:46
David Crow24-Jun-15 3:46 
AnswerRe: Windows 8.1 Event log problem Pin
zeki yugnak24-Jun-15 4:16
zeki yugnak24-Jun-15 4:16 
QuestionHow to best pull together data from multiple sources (hardware sensors) in Win32? Pin
MW-83121724-Jun-15 2:29
MW-83121724-Jun-15 2:29 
Hi all,
this is my first question in this forum. I'd like to begin it by saying hello to everyone.

I am writing a Win32 application that uses multiple sensors, such as the Kinect V2, and a couple of other sensors that complement Kinect's capabilities. These other sensors are interfaced with the PC via the Serial Port. Both the Kinect and the other sensors produce data samples periodically at similar time intervals.

The challenge I face is how to best pull all of these data samples together into my application. What I mean by that is how to best structure my program in order to get the data in effitiently. I think it's a Producer-Consumer type of a problem.

The idea I have is to read the data samples from each of the external sources in a separate Reader Thread. Each of these theads would fire an event when a new sample has been received. The Main Thread would pick up these events using the WaitForMultipleObjects() function, as described [here]. This should provide enough synchronization.

The Main Thread, I call it a Producer Thread, would copy all of the arriving data into a custom frame class. This frame would then be pushed into a FIFO queue. A Consumer Thread would pop and process these custom frames from the FIFO at full speed.

Yes, I realise that this application is resource-hungry. The Consumer Thread pops frames at a lower rate than the frames are pushed onto the FIFO. The PC I develop it on should be able to handle it with with 16GB of RAM and the latest i7 CPU. Real-time operation is not required. Also, the program should complete before RAM fills up.

I wonder if my approach and more importantly the thought process I have is correct? I wonder if there would be a better approach for this type of an application? I don't seem to see a better way.


Thanks,
MW
AnswerRe: How to best pull together data from multiple sources (hardware sensors) in Win32? Pin
CPallini24-Jun-15 2:37
mveCPallini24-Jun-15 2:37 
GeneralRe: How to best pull together data from multiple sources (hardware sensors) in Win32? Pin
MW-83121724-Jun-15 3:08
MW-83121724-Jun-15 3:08 
GeneralRe: How to best pull together data from multiple sources (hardware sensors) in Win32? Pin
CPallini24-Jun-15 3:18
mveCPallini24-Jun-15 3:18 
GeneralRe: How to best pull together data from multiple sources (hardware sensors) in Win32? Pin
Albert Holguin24-Jun-15 11:57
professionalAlbert Holguin24-Jun-15 11:57 
GeneralRe: How to best pull together data from multiple sources (hardware sensors) in Win32? Pin
CPallini24-Jun-15 12:11
mveCPallini24-Jun-15 12:11 
GeneralRe: How to best pull together data from multiple sources (hardware sensors) in Win32? Pin
Albert Holguin24-Jun-15 12:16
professionalAlbert Holguin24-Jun-15 12:16 
AnswerRe: How to best pull together data from multiple sources (hardware sensors) in Win32? Pin
Albert Holguin24-Jun-15 12:04
professionalAlbert Holguin24-Jun-15 12:04 
GeneralRe: How to best pull together data from multiple sources (hardware sensors) in Win32? Pin
MW-83121724-Jun-15 23:55
MW-83121724-Jun-15 23:55 
GeneralRe: How to best pull together data from multiple sources (hardware sensors) in Win32? Pin
Albert Holguin25-Jun-15 9:24
professionalAlbert Holguin25-Jun-15 9:24 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.