Check-in [f10cec2a0d]

Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Editorial changes
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk | editorial
Files: files | file ages | folders
SHA3-256: f10cec2a0dd84e0b4ddd0757f0b7efd575e74ebe698b37a59bbc167201d246cb
User & Date: dkf 2018-04-16 17:49:43.418
Context
2018-04-19
09:58
Tip #425 In voting, until [clock format 1525089600] check-in: 76806b9c40 user: jan.nijtmans tags: trunk
2018-04-16
17:49
Editorial changes check-in: f10cec2a0d user: dkf tags: editorial, trunk
2018-04-15
12:49
TIP #496 now in VOTING state check-in: 7ce98343a5 user: fvogel tags: trunk
Changes
Unified Diff Ignore Whitespace Patch
Changes to tip/491.md.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60

61


62
63
64
65
66
67
68
# TIP 491: Threading Support: phasing out non-threaded builds
	Author:         Jan Nijtmans <[email protected]>
	State:          Draft
	Type:           Project
	Vote:           Pending
	Created:        11-Dec-2017
	Post-History:
	Keywords:       threads
	Tcl-Version:    8.7
-----

# Abstract

Since TIP #364 proposed improving thread support, time has come to gradually phase out
non-threaded builds on all platforms. On Windows and MacOSX, there are known problems
on non-threaded build. But also on UNIX it is becoming increasingly difficult to support
both threaded and non-threaded builds. This TIP proposes a gradual deprecation and removal
of support for non-threaded builds.

# Rationale

Non-threaded builds have a number of known problems:

    * On Windows, dde and sockets don't work correctly, as they need threads to operate.

	* On UNIX, the new epoll() and kqueue() notifiers (TIP #458) expect the pthread locking to be available.

Further on, the nmake build system uses a different suffix "t" than the autoconf-based build system, a historical
mistake that cannot be corrected in a patch release. Let's correct that in Tcl 8.7.

A common misconception is that non-threaded builds are necessary to make vfork and/or signals work correctly. That
may have been true in the past, but not any more: vfork works fine in threaded builds, the only caveat is that
threads started before the vfork don't survive the fork. So, as long as new threads are created after doing the fork,
everything should work fine. Applications like AOLserver use this already.
	
# Proposal

  * Include the following snippet in tcl.h:
  <pre>
     #ifndef TCL\_THREADS
	 #   define TCL\_THREADS 1
	 #endif
  </pre>

  * Include the following snippet in tclInt.h:
  <pre>
     #if TCL\_THREADS && !defined(USE\_THREAD\_ALLOC)
	 #   define USE\_THREAD\_ALLOC 1
	 #endif
  </pre>

This means that the (nmake/autoconf) build systems no longer need to explicitely set those
two options, a threaded build will be the default. Non-threaded builds are still possible,
adding the flag "-DTCL_THREADS=0" to the Makefile. Hopefully this further discourages
non-threaded builds.

  * In the autoconf build system, remove the --disable-threads option.

  * In the nmake build system, don't use "t" any longer as suffix, and remove the "nothreads" and "thrdalloc" build options.


  * In Tcl 9, fully remove the use of TCL_THREADS throughout the whole source code. The value "1" is assumed


    everywhere. Non-threaded builds are no longer possible.

# Implementation

An implementation of this TIP can be found in the [tip-491](https://core.tcl.tk/tcl/timeline?r=tip-491) branch.

# Copyright













|









|

|

|


|
|


|


|






|








|


|

|

>
|
>
>







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
# TIP 491: Threading Support: phasing out non-threaded builds
	Author:         Jan Nijtmans <[email protected]>
	State:          Draft
	Type:           Project
	Vote:           Pending
	Created:        11-Dec-2017
	Post-History:
	Keywords:       threads
	Tcl-Version:    8.7
-----

# Abstract

Since [TIP #364](364.md) proposed improving thread support, time has come to gradually phase out
non-threaded builds on all platforms. On Windows and MacOSX, there are known problems
on non-threaded build. But also on UNIX it is becoming increasingly difficult to support
both threaded and non-threaded builds. This TIP proposes a gradual deprecation and removal
of support for non-threaded builds.

# Rationale

Non-threaded builds have a number of known problems:

 * On Windows, DDE and sockets don't work correctly, as they need threads to operate.

 * On UNIX, the new `epoll()` and `kqueue()` notifiers ([TIP #458](458.md)) expect the pthread locking to be available.

Further on, the nmake build system uses a different suffix, `t`, than the autoconf-based build system, a historical
mistake that cannot be corrected in a patch release. Let's correct that in Tcl 8.7.

A common misconception is that non-threaded builds are necessary to make `vfork()` and/or signals work correctly. That
may have been true in the past, but not any more: `vfork()` works fine in threaded builds, the only caveat is that
threads started before the vfork don't survive the fork. So, as long as new threads are created after doing the fork,
everything should work fine. Applications like AOLserver use this already.

# Proposal

  * Include the following snippet in `tcl.h`:
  <pre>
     #ifndef TCL\_THREADS
	 #   define TCL\_THREADS 1
	 #endif
  </pre>

  * Include the following snippet in `tclInt.h`:
  <pre>
     #if TCL\_THREADS && !defined(USE\_THREAD\_ALLOC)
	 #   define USE\_THREAD\_ALLOC 1
	 #endif
  </pre>

This means that the (nmake/autoconf) build systems no longer need to explicitely set those
two options, a threaded build will be the default. Non-threaded builds are still possible,
adding the flag `-DTCL_THREADS=0` to the Makefile. Hopefully this further discourages
non-threaded builds.

  * In the autoconf build system, remove the `--disable-threads` option.

  * In the nmake build system, don't use `t` any longer as suffix, and remove the `nothreads` and `thrdalloc` build options.

In Tcl 9:

  * fully remove the use of `TCL_THREADS` throughout the whole source
    code. The value is assumed to be `1`
    everywhere. Non-threaded builds are no longer possible.

# Implementation

An implementation of this TIP can be found in the [tip-491](https://core.tcl.tk/tcl/timeline?r=tip-491) branch.

# Copyright