From: SourceForge.net <no...@so...> - 2004-11-24 20:24:59
|
Bugs item #1071807, was opened at 2004-11-23 10:42 Message generated for change (Comment added) made by kennykb You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=110894&aid=1071807&group_id=10894 Category: 01. Notifier Group: current: 8.4.8 >Status: Closed >Resolution: Fixed Priority: 5 Submitted By: Salem Ganzhorn (eyekode) Assigned to: Kevin B KENNY (kennykb) Summary: select() loop notifys wrong fd's Initial Comment: On Sun 64 platforms the math for calculating the fd_set bit is wrong. tclUnixNotfy.c:443 bit = 1 << (fd%(NBBY*sizeof(fd_mask))); sizeof(fd_mask) is 8, but sizeof(1) is 4. The easiest fix for this is to change bit && "1" to unsigned long. Note: this code pattern is copy/pasted throughout this file, and all places need to be fixed. However, out of curiosity, why aren't we using FD_SET/ISSET etc? ---------------------------------------------------------------------- >Comment By: Kevin B KENNY (kennykb) Date: 2004-11-24 15:24 Message: Logged In: YES user_id=99768 On reading the code, it appears that the lack of FD_SET/FD_ISSET is a misguided attempt at performance enhancement, when the select masks from the subthreads are OR-ed together to form the select mask of the Notifier thread. While the FD_* code is ugly, it looks to be The Right Thing moving forward, at least until poll() is ubiquitous (or we introduce a compat/ version of it). The HEAD and the tip of the 8.4 branch now use the FD_* macros. ---------------------------------------------------------------------- Comment By: Kevin B KENNY (kennykb) Date: 2004-11-23 10:51 Message: Logged In: YES user_id=99768 The fact that we don't use FD_SET/FD_ISSET is quite an archaeism. At the time the code was written, there were still a fair number of non-POSIX operating systems out there that didn't have the FD_ macros. I'll have a look at this. FD_SET and FD_ISSET are clearly preferable if they work everywhere now (as I believe they do). ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=110894&aid=1071807&group_id=10894 |