[interfacekit] Re: BHandler::fToken

Erik Jaesler <erik@xxxxxxxxxxxxxx> wrote:
> > There is just one little problem with that method (depends on the 
> > implementation, though :-)): when the token counter overflows, 
> > there 
> > are about 4 billion entries on the stack... hm... that doesn't 
> > sound 
> > very nice, does it=3D3F :-)
> Well, I suppose if I used a *little* intelligence I might think to 
> put 
> some kind of cap on the size of the queue. ;)  Perhaps a few hundred 
> or 

Hehe :-)

> a thousand tokens=3F  My thinking is that while you probably aren't *
> ever* 
> going to overflow the counter and use the entire capacity of the 
> queue 
> at one time, if you find yourself enjoying the extended up-time that 
> is 
> often the priviledge of the BeOS user =3D) you may, over time, overflow 
> the counter.  It would be a bummer if from there on out, every 
> allocated 
> handler token had to checked against the map to make sure it wasn't 
> being used -- the queue gives us a fast way to get tokens we *know* 
> aren't being used.  Granted, your box would have to be up a *very* 
> long 
> time before you overflowed the counter; nevertheless, it would be 
> nice 
> if the general case was that you either got a token based on the 
> counter 
> or from the queue rather than having to do the check.

Well, if it's already there, I'd say, go for it :-)
OTOH looking up a token should be very fast, since we have to do that 
all the time, even more often than creating/deleting them.

Adios...
   Axel.



Other related posts: