[interfacekit] Re: BLooper reusability

"Axel D=F6rfler" <axeld@xxxxxxxxxxxxxxxx> wrote:
> 
> "Adi Oanca" <e2joseph@xxxxxxxxxx> wrote:
> > Our task=3D5Flooper() will be modified, to read with a timeout of 0 
> > from
> > BLooper's standard port and from other incoming sources. If no 
> > message is
> > received, in order not to use our timeslice in vain, we will 
> > 'snooze' 
> > for a
> > bit, making the kernel to reschedule our thread. 
> 
> I see this as the biggest disadvantage - this is busy waiting, and I 
> certainly don't want to have this in a standard class like the 
> BLooper.
> I would rather wait with such an approach for 
> wait=3D5Ffor=3D5Fmultiple=3D5Fobjects() like function (which will be one 
> thing we 
> want to have in R2), or have a second looper which gets the messages 
> from the other source and redirects it to the other one.
> I don't know how BWindow does that, but busy polling is not an option 
> for the application kit's fundamental classes IMO.

I suppose the R5 BWindow implementation has not that much options. It 
needs to wait for messages at two ports, but there's no function to do 
that (nor for semaphores). At least I wouldn't see any other way than 
polling.

However, I absolutely agree with you, the changing BLooper so that 
polling is required by design is definitely not a good idea.

CU, Ingo


Other related posts: