[Gambas-user] Asking about a new Command

Benoit Minisini gambas at ...1...
Wed May 24 21:00:26 CEST 2006


On Wednesday 24 May 2006 20:32, nando wrote:
> Thanks to everyone for your replies.
>
> This project is over a year in the making at considerable cost
> and is quite involved.  It operates as a set of concurrent multiple
> programs and runs on hundreds of computers.  There is use of some
> specialized communication equipment.
>
> The particular problem is I need to wait a small amount of time
> for a particular hardware condition to be ready.
>
> In my case, with Serial Port characters streaming in, if I use
> the WAIT 0.5, inside the _Read, it will recurse more _Reads while
> the processing of the first is incomplete.
> This actually makes the stream processed out of order because
> the 'newer' _Read process the next char while the original _Read
> that invoked the WAIT is still unfinished.
> So, processing events is forbidden in this case.
>
> A empty loop consumes CPU...other programs are running.
> WAIT allows processing of things out of order.
> Although the SHELL sleep works, it is too much overhead.
>
> This problem exists in the VB world when using DoEvents.
> My solution in the VB world is to use a Boolean inside
> the critical SUBs that can recurse and simply exit when busy.
> That too, still uses too much CPU because there are always
> characters waiting and _Read will 'event' by the interpreter
> just to do a quick exit.
>
> A Delay statement sounded like a you might have been interested in.
> Essentially it would be sleeping using the kernel.
>
> Eventhough we use fast computers, managing and minimizing CPU usage
> is still an important item.
>
> Of course, I may be ignorant and uninformed of other ways and
> overlooking something easy...to which you all have been helpful.
>
> Thanks
> -Fernando
>

I see... The stable version being frozen, can you use the development version?

-- 
Benoit Minisini





More information about the User mailing list