Threads?

Alexander Panek a.panek at brainsware.org
Wed Nov 15 20:18:28 PST 2006


Does the output really have to be with 50Hz, or do you simply want to 
trigger output with a frequency of 50Hz? You could start a thread 
everytime that puts that stuff onto the screen, while your main loop 
just continues.

Apart from that you could also use a seperate thread that outputs a 
stack that is filled up by your main routine.

How exactly do you ensure that your main routine runs with ~1kHz? Sounds 
quite need-to-hack-timer-interrupt-ish :P .

Alex

nobody_ wrote:
> How do I make a thread run at a certain rate (x times a second ) without 
> bothering the rest of the program?
> 
> The main-loop runs at about 1000hz and I need to output some of the data to 
> my screen at about 50/60Hz.
> I don't care whether there are frames lost, as long as the main loop runs 
> correctly.
> 
> Or shouldn't I use a seperate thread for the screenoutput?
> 
> Thx 
> 
> 



More information about the Digitalmars-d-learn mailing list