[interfacekit] Re: BHandler::fToken

On Tue, 11 Mar 2003, Erik Jaesler wrote:

[...]
> Anyway, this is all moot.  Given your figures above, I'm getting rid of
> the cache.  If an app manages to chew up the entire 32 bit token space
> in the span of a single execution, it'll just end up in the debugger or
> something. =)

Again: Why not introduce an additional boolean flag into BTokenSpace that
is set, when the counter wraps around, and causes the tokens to be checked
against the map before being issued? That's only three or four lines more
code without performance penalty for the common case, and it ensures that
apps with a somewhat strange usage pattern of BHandlers/BViews will still
work (in average also without performance problems).

BTW, I even could imagine such an application. Just think of a server that
is able to handle hundreds of connections per seconds and creating a
handler (or looper) per connection. Then it could exhaust the token space
in a year or earlier.

CU, Ingo

Other related posts: