[interfacekit] Re: BHandler::fToken

  • From: "Adi Oanca" <e2joseph@xxxxxxxxxx>
  • To: <interfacekit@xxxxxxxxxxxxx>
  • Date: Sat, 8 Mar 2003 14:13:27 +0200


Ingo, you were right, in my last e-mail I said that I will use
BWindow::server_token and BView::server_token; but I've realized that an
open discussion about this should determine the best way to implement server
token facility.

So, the current best way to do this is by using "server_token" member. But
as Ingo suggested, it can also be done by passing pointers as tokens. I
think
that this is a VERY good idea, because of the speed a BView/BWindow is
found (dynamic casting).

But, there is(or may not be if I'm wrong) another catch! As far as I know,
pointers, in user-space, are virtual; pointers in user-space begin at
0x00000000, and when they are used, the kernel calculates the real address
by adding the address at witch the process resides.
This means that there may be two server tokens that have the same value. Now
we do not that to happen, so we will make a list of tokens for every
BApplication that is launched. You may say: But wait, a token(e.g. a view)
must be uniquely identified in the app_server!!! Well... as far as I know
(and here, we must ask DarkWyrm!) there is no need to uniquely identify a
token in the hole app_server (except for BApplication, that I don't know if
it has a server token associated; I think not)! We just need to uniquely
identify a token for all the windows and views that are associated with a
BApplication object! Thus, when app_server spawns a thread for BApplication,
an empty list of known tokens may be created, and when windows or views are
added, the token list grows.




Other related posts: