Artifacts Associated With Ticket eeddb0693a950be9
Ticket change [d6e9e69645] (rid 163199) by dkf on 2018-05-20 14:57:52:
- assignee initialized to: "nobody"
- closer initialized to: "nobody"
- cmimetype initialized to: "text/html"
- comment initialized to:
Given that all our source code will pass this stanza early in tcl.h: <pre> #ifndef TCL_THREADS # define TCL_THREADS 1 #endif </pre> Why do we then write this in so many places? <pre> #if !defined(TCL_THREADS) || TCL_THREADS </pre> Surely (given that we know TCL_THREADS is defined, and it is assumed to be numeric), it'd be enough to do this: <pre> #if TCL_THREADS </pre> That'd make the code more readable if nothing else.
- is_private initialized to: "0"
- login: "dkf"
- priority initialized to: "5 Medium"
- resolution initialized to: "None"
- severity initialized to: "Cosmetic"
- status initialized to: "Open"
- submitter initialized to: "dkf"
- subsystem initialized to: "49. Threading"
- title initialized to: "TIP #491 implementation has odd #ifdef usage"
- type initialized to: "Bug"
Ticket change [7cfb503acd] (rid 163200) by dkf on 2018-05-20 14:58:19:
- assignee changed to: "jan.nijtmans"
- login: "dkf"
- mimetype: "text/plain"
- priority changed to: "3 Low"
Ticket change [d421fd4eaf] (rid 163205) by jan.nijtmans on 2018-05-21 08:11:00:
- closedate changed to: "2458259.84097813"
- closer changed to: "jan.nijtmans"
- icomment:
This is on purpose. It makes Tcl build also without TCL_THREADS defined, as is done in Tcl 9. Otherwise all #ifdef's regarding TCL_THREADS would be different in core-8-branch and trunk, which only increases the possibility of future merge conflicts. Actually, I misplaced one #endif in tcl.h (fixed now), which demonstrates how Tcl can build WITHOUT TCL_THREADS defined. So, yes, it makes all #ifdefs somewhat more complicated. But that doesn't really matter because in Tcl 9 we should gradually remove all of them anyway. (I don't want to do it yet, not before Tcl 8.7 is finally released, because there might be protests regarding non-threaded builds. So - for now - I want to keep Tcl building with TCL_THREADS=0)
- login: "jan.nijtmans"
- mimetype: "text/plain"
- resolution changed to: "Invalid"
- status changed to: "Closed"
Ticket change [2fb76d6e6f] (rid 163219) by dkf on 2018-05-21 10:08:50:
- closedate changed to: "2458259.92281192"
- closer changed to: "dkf"
- icomment:
I was approving the: <pre> #ifndef TCL_THREADS # define TCL_THREADS 1 #endif </pre> It was the fact that <strong>after</strong> that, we can just use: <pre> #if TCL_THREADS </pre> since we can know that TCL_THREADS is definitely defined. If it wasn't, the ifndef/define pair would have set it to 1. In other words, everything that includes tcl.h will define TCL_THREADS so <code>!defined(TCL_THREADS)</code> is a constant (zero), and we assume that it is boolean (which I also approve of). <p> Basically, <code>#if !defined(TCL_THREADS) || TCL_THREADS</code> can now become just <code>#if TCL_THREADS</code> with no ill-effects that I can think of.
- login: "dkf"
- mimetype: "text/html"
Ticket change [a15f9208aa] (rid 163228) by dgp on 2018-05-22 11:56:38:
- closedate changed to: "2458260.99766238"
- closer changed to: "dgp"
- icomment:
Consider this approach. On core-8-branch, put in place the simpler scheme dkf is suggesting. Then for the sake of clean merges, make trunk the same everywhere except in tcl.h have a single explicit line: #define TCL_THREADS 1 Then on the trunk we still have the known condition that every file that includes tcl.h has TCL_THREADS defined and we need not test for that. But we have also deleted all "easy" ways to call for a thread-disabled build. Over time, all tests for TCL_THREADS should disappear from trunk, and as soon as they are all gone, that line can go too. Any troubles with that?
- login: "dgp"
- mimetype: "text/plain"
Ticket change [774ac6666a] (rid 163229) by jan.nijtmans on 2018-05-22 20:01:58:
- closedate changed to: "2458261.33470601"
- closer changed to: "jan.nijtmans"
- icomment:
I'm spotting the possibility for a nice compromise: How about #defining TCL_THREADS in tclInt.h too? This makes the simplifications possible as dkf noted, but it doesn't affect the public API. I can very well live with that. Hang on .....
- login: "jan.nijtmans"
- mimetype: "text/plain"
Ticket change [0a61011117] (rid 163264) by jan.nijtmans on 2018-05-22 20:54:36:
- closedate changed to: "2458261.37125439"
- icomment: "So have a look at core-8-branch now ..."
- login: "jan.nijtmans"
- mimetype: "text/plain"
- resolution changed to: "Fixed"
Ticket change [973373e12a] (rid 163274) by dgp on 2018-05-23 12:39:59:
- closedate changed to: "2458262.02777139"
- closer changed to: "dgp"
- icomment:
The idea sounds promising. At the moment though the core-8-branch doesn't build. ... /home/dgp/fossil/tcl8.7/unix/tclSelectNotfy.c In file included from /home/dgp/fossil/tcl8.7/unix/tclSelectNotfy.c:262:0: /home/dgp/fossil/tcl8.7/unix/tclUnixNotfy.c: In function ‘Tcl_AlertNotifier’: /home/dgp/fossil/tcl8.7/unix/tclUnixNotfy.c:126:18: error: ‘ThreadSpecificData’ has no member named ‘triggerEventFd’ if (write(tsdPtr->triggerEventFd, &eventFdVal, ^ /home/dgp/fossil/tcl8.7/unix/tclSelectNotfy.c: In function ‘Tcl_WaitForEvent’: /home/dgp/fossil/tcl8.7/unix/tclSelectNotfy.c:703:2: warning: implicit declaration of function ‘StartNotifierThread’ [-Wimplicit-function-declaration] StartNotifierThread("Tcl_WaitForEvent"); ^ /home/dgp/fossil/tcl8.7/unix/tclSelectNotfy.c: In function ‘NotifierThreadProc’: /home/dgp/fossil/tcl8.7/unix/tclSelectNotfy.c:1061:3: warning: implicit declaration of function ‘AlertSingleThread’ [-Wimplicit-function-declaration] AlertSingleThread(tsdPtr); ^ /home/dgp/fossil/tcl8.7/unix/tclSelectNotfy.c: At top level: /home/dgp/fossil/tcl8.7/unix/tclSelectNotfy.c:200:13: warning: ‘AtForkChild’ used but never defined [enabled by default] static void AtForkChild(void); - login: "dgp"
- mimetype: "text/plain"
Ticket change [7dfb4e261c] (rid 163275) by dgp on 2018-05-23 12:41:41:
- closedate changed to: "2458262.02895735"
- icomment:
Looks like a two part mystery. 1) Why build the select notifier? I'm expecting the epoll. 2) Once we decide to bulid the select notifier, why doesn't it?
- login: "dgp"
- mimetype: "text/plain"
Ticket change [e9a25b9397] (rid 163276) by dgp on 2018-05-23 13:08:18:
- closedate changed to: "2458262.04744016"
- icomment:
It's only the last checkin [bf06e36b25] that broke things, so maybe we can look at it and figure out what went wrong.
- login: "dgp"
- mimetype: "text/plain"
Ticket change [9f1842e7c4] (rid 163277) by dgp on 2018-05-23 13:34:52:
- closedate changed to: "2458262.06588265"
- icomment:
Shifting the placement of the internal header includes seems to take care of it.
- login: "dgp"
- mimetype: "text/plain"
Ticket change [0773bce4ce] (rid 163425) by jan.nijtmans on 2018-05-25 08:45:34:
- closedate changed to: "2458263.86498079"
- closer changed to: "jan.nijtmans"
- icomment:
Thanks, Don for your fixes! Still not all CFLAG handlings were correct, but everything should be corrected now. I hope the current implementation satisfies everyone.
- login: "jan.nijtmans"
- mimetype: "text/plain"