Documentation: System{Prop:Threading}

A recent conversation on cw-talk brought up the question of system{prop:threading} and the docs appear to be very thin on the topic, so in lieu of anywhere else to post this, I’m posting this documentation here.

The System{prop:threading} is a (system) property in a program which enables, or disables, the ability of the program to start new threads.

The default value for this property is true, meaning that a program can start as many threads as it wants - limited only by available memory.

If set to false then the program cannot start a second (or subsequent) thread. Everything in the application takes place on thread 1.

When running in this mode an APPLICATION (aka MDI Frame procedure) does not START any child windows, it effectively just calls them. Equally all MDI child windows behave as SDI windows (ie windows without the MDI attribute), the application is completely modal, and the windows are not “bound” inside the application frame.

The primary advantage of this approach is that the program is no longer an MDI program, so the (formerly) MDI children windows are drawn with regular SDI window borders.
Also, because there is no opportunity for a second thread, the program is completely thread-safe.

The disadvantages to this approach though are numerous.
a) No background threads are possible.
b) No Toolbox windows
c) Child windows are not bound by the application frame
d) No ability to multi-task - for example entering new data over here while generating a report over there, while doing a big batch import somewhere else
e) no NetTalk (since NetTalk uses a background thread to handle TCP communications.)
f) no “background” window on the main frame
and so on

5 Likes