pthread_t as component of hash function in TSRM
| From: | Manoj Kasichainula | Date: | Mon, 28 Jun 1999 07:23:46 +0000 |
| Subject: | pthread_t as component of hash function in TSRM | ||
| Groups: | php.version4 | ||
| Request: | Send a blank email to php-version4+get-1709@lists.php.net to get a copy of this message | ||
Rasmus suggested I take a look at the PHP4 code and make suggestions.
I'm not on this list at the moment, so please cc: me on responses.
One problem I noticed is that the thread ID is used to create a hash
value (TSRM.c:198 in ts_resource(), for example). The problem here is
that pthread_t is an opaque quantity, and isn't guaranteed to be an
integer by the pthread standard, so THREAD_HASH_OF() could fail. And
supposedly, pthread_t is a structure on HP-UX.
For the pthread case, maybe TSRM could use the pthread TLS functions
(pthread_{get,set}specific, etc.). When used with Apache, it could
hash on the request_rec, or just store stuff in the request_rec. The
advantage of this would be that TSRM would still work as expected
under the async server models that Dean Gaudet and co. are working on.
--
Manoj Kasichainula - manojk at io dot com - http://www.io.com/~manojk/
"'Why do you blow on people?' I don't know." -- Benny Hinn