Click here to Skip to main content
15,887,214 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
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 
GeneralRe: How to best pull together data from multiple sources (hardware sensors) in Win32? Pin
MW-83121726-Jun-15 3:04
MW-83121726-Jun-15 3:04 
QuestionSDI Project Question Pin
Arrin23-Jun-15 9:00
Arrin23-Jun-15 9:00 
SuggestionRe: SDI Project Question Pin
David Crow23-Jun-15 9:50
David Crow23-Jun-15 9:50 
GeneralRe: SDI Project Question Pin
Arrin23-Jun-15 12:21
Arrin23-Jun-15 12:21 
QuestionUse #define or enum in switch() case(s) ? Pin
Vaclav_22-Jun-15 5:40
Vaclav_22-Jun-15 5:40 
AnswerRe: Use #define or enum in switch() case(s) ? Pin
PIEBALDconsult22-Jun-15 5:51
mvePIEBALDconsult22-Jun-15 5:51 
AnswerRe: Use #define or enum in switch() case(s) ? Pin
Jochen Arndt22-Jun-15 6:51
professionalJochen Arndt22-Jun-15 6:51 
AnswerRe: Use #define or enum in switch() case(s) ? Pin
Albert Holguin22-Jun-15 9:49
professionalAlbert Holguin22-Jun-15 9:49 

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.