Click here to Skip to main content
15,888,106 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionListView, tile mode & multiple lines - how??? Pin
Vlasta_9-Oct-07 12:25
Vlasta_9-Oct-07 12:25 
AnswerRe: ListView, tile mode & multiple lines - how??? Pin
Roger Broomfield9-Oct-07 20:13
Roger Broomfield9-Oct-07 20:13 
GeneralRe: ListView, tile mode & multiple lines - how??? Pin
Vlasta_9-Oct-07 22:45
Vlasta_9-Oct-07 22:45 
QuestionOverlapping queuing times - best method? Pin
Iain Clarke, Warrior Programmer9-Oct-07 10:02
Iain Clarke, Warrior Programmer9-Oct-07 10:02 
AnswerRe: Overlapping queuing times - best method? Pin
Leslie Sanford9-Oct-07 14:39
Leslie Sanford9-Oct-07 14:39 
GeneralRe: Overlapping queuing times - best method? Pin
Iain Clarke, Warrior Programmer11-Oct-07 6:05
Iain Clarke, Warrior Programmer11-Oct-07 6:05 
GeneralRe: Overlapping queuing times - best method? Pin
El Corazon11-Oct-07 6:35
El Corazon11-Oct-07 6:35 
AnswerRe: Overlapping queuing times - best method? Pin
El Corazon9-Oct-07 15:04
El Corazon9-Oct-07 15:04 
Iain Clarke wrote:
I have a series of inputs to my software.

Imagine... If Input A - turn an output on in 5 seconds for 2 second.
If Input B, turn an output on in 3 seconds for 2.5 seconds.


I deal with this pretty regularly, all our inputs are asynchronous. I guess I should ask, what is the output? Do you want to blend the output of two things during a "double on" situation? do you want to put one at higher priority? How exactly do you wish to handle a double on situation. Forget the implimentation at the moment, start from the statement of action. You have multiple inputs.... double off, no problem, no output. Single on, single off, single output, again no problem. So then comes the doozy, the exception case, double/many on, what do you see as the preferred output? what is the output? where is it going? Is .1 second check the preferred output format? would you alternate between any/all outputs? is there a priority involved where one output should always be first?

I have one situation with position data where sources number n, some unknown number at startup, 1 to many. The code channels the input to a variety of parallel threads to handle the data as rapidly as it comes in. The output is simply stored in an implicetly shared structure that is read from another thread, synced to video (60 times a second). The result is asynchronous output, though the time can be requested in synchronized form given time sync filtering.

In another case, my streaming debugger for embedded applications, many threads feed a ring buffer that feeds a transmit thread for sending debugging information. This allows for n threaded debugging or any system on a network. N threads feeds 1 thread via single channel shared structure similar to a queue (a ring buffer is just an over-glorified queue with fixed memory footprint).

You can always have a queue of "on" events, rather than check all states, setup another queue, though with a read-only option, probably as a vector or ring buffer because of the fixed memory state. Then you need only "push" an on-event onto the "active" state list. Another thread can read and process only the active states sending output, handling priorities, and "pop" completed activities. We do this for a state engine for script events which is always an asynchronous many to many relationship. My goal is always to keep things asynchronous as the input until the very last frame before display, then synchronize if necessary. But that is because I know my data input is always asynchronous, synchronizing it only lowers its accuracy, so I want to do as little as I have to of manipulation of data.

You can also simulate a threaded operation using any heart-beat hardware event from the host system, from idle calls, to timers, to screen refreshes (vsync), etc.

_________________________
Asu no koto o ieba, tenjo de nezumi ga warau.
Talk about things of tomorrow and the mice in the ceiling laugh. (Japanese Proverb)

GeneralRe: Overlapping queuing times - best method? Pin
Iain Clarke, Warrior Programmer11-Oct-07 6:06
Iain Clarke, Warrior Programmer11-Oct-07 6:06 
QuestionHow to get pointer to client area in CDialog in SDI app?? Pin
zarraza9-Oct-07 9:22
zarraza9-Oct-07 9:22 
AnswerRe: How to get pointer to client area in CDialog in SDI app?? Pin
Iain Clarke, Warrior Programmer9-Oct-07 10:07
Iain Clarke, Warrior Programmer9-Oct-07 10:07 
GeneralRe: How to get pointer to client area in CDialog in SDI app?? Pin
zarraza9-Oct-07 10:37
zarraza9-Oct-07 10:37 
GeneralRe: How to get pointer to client area in CDialog in SDI app?? Pin
Iain Clarke, Warrior Programmer9-Oct-07 11:05
Iain Clarke, Warrior Programmer9-Oct-07 11:05 
GeneralRe: How to get pointer to client area in CDialog in SDI app?? Pin
zarraza9-Oct-07 11:25
zarraza9-Oct-07 11:25 
GeneralRe: How to get pointer to client area in CDialog in SDI app?? Pin
Iain Clarke, Warrior Programmer9-Oct-07 11:30
Iain Clarke, Warrior Programmer9-Oct-07 11:30 
GeneralRe: How to get pointer to client area in CDialog in SDI app?? Pin
zarraza9-Oct-07 11:50
zarraza9-Oct-07 11:50 
GeneralRe: How to get pointer to client area in CDialog in SDI app?? Pin
Roger Broomfield9-Oct-07 15:29
Roger Broomfield9-Oct-07 15:29 
GeneralRe: How to get pointer to client area in CDialog in SDI app?? Pin
zarraza10-Oct-07 11:41
zarraza10-Oct-07 11:41 
Questionvc++code for designing a scientific calculator Pin
AvishekBanerjee9-Oct-07 5:24
AvishekBanerjee9-Oct-07 5:24 
AnswerRe: vc++code for designing a scientific calculator Pin
David Crow9-Oct-07 5:42
David Crow9-Oct-07 5:42 
AnswerRe: vc++code for designing a scientific calculator Pin
toxcct9-Oct-07 5:44
toxcct9-Oct-07 5:44 
AnswerRe: vc++code for designing a scientific calculator Pin
Maximilien9-Oct-07 6:45
Maximilien9-Oct-07 6:45 
AnswerRe: vc++code for designing a scientific calculator Pin
Mark Salsbery9-Oct-07 8:12
Mark Salsbery9-Oct-07 8:12 
JokeRe: vc++code for designing a scientific calculator Pin
Hamid_RT9-Oct-07 9:44
Hamid_RT9-Oct-07 9:44 
AnswerRe: vc++code for designing a scientific calculator Pin
Hamid_RT9-Oct-07 9:54
Hamid_RT9-Oct-07 9:54 

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.