in reply to Re: Dormus interruptus
in thread Dormus interruptus

Why thread this? If I were to take a completely linear approach, then it would look something like:

while (!$quit) { gatherData1 (); gatherData2 (); gatherData3 (); renderData (); ReadMode 'cbreak'; $quit = 1 if defined (my $char = ReadKey (0)) && $char eq 'q'; ReadMode 'normal'; }
But there are three sets of data here from different sources. There is a dramatic difference in the cost of gathering those three data sets. Data set 1 is gathered from memory, and data set 3 is an expensive, asynchronous query, data set 2 is file I/O. I would like the high refresh rate to see the data that changes often.

I understand the issues involved with threading, and I don't do this lightly, but I didn't see another way to accomplish this, and get the desired result.