@cyclicalobsessive,
In the past several threads on python paths, mutexes, and such-like you have discussed various kinds of programming “things” like programs, processes, and threads and:
-
In some cases, you appear to use the terms interchangeably, as if they’re synonyms for each other.
-
In other cases, you specifically stamp your feet, insisting that they’re all different beasties.
OK, 'fess up. What is it?
My guesses:
-
Programs, processes, and threads are all different though they may share a common heritage.
-
Definitions:
- A program is a stand-alone module that can be used either by itself or with other things to accomplish a task.
- A library is a special case of a program where, though it might not be uniquely executable by itself, it provides valuable services to the including program.
- An “included” library becomes a local “instance” of the library file itself subsumed into the program, almost as if it had been cut-and-pasted into it. (bad use of words, but I don’t know how to express it better.)
- A process is the system’s instance of a running program.
- Processes can be spawned by executing a program, the operating system executing a program, (or a service which is a special case of a program), or by something else running a program, (for example, the program you just ran.)
- A thread is a special kind of programmatic process where a program, in essence, does two, (or more), things at the same time.
- Threads are owned by the process that spawned them.
- Threads are owned by the process that spawned them.
- A program is a stand-alone module that can be used either by itself or with other things to accomplish a task.
-
Scope:
-
Programs/Processes:
- A program has it’s own process and the process has its own local scope. Anything included on imported into the program is subsumed into the local scope.
- A program has it’s own process and the process has its own local scope. Anything included on imported into the program is subsumed into the local scope.
-
Libraries:
Libraries become a part of the local scope of what subsumes them.- However, (especially in the case of libraries made up of classes), the individual routines withing the library can have their own local sub-scope.
- However, (especially in the case of libraries made up of classes), the individual routines withing the library can have their own local sub-scope.
-
Threads:
-
Threads are “sub-processes” spawned by a particular process and share the processes local scope. (i.e. Anything owned by any part of the process is owned and accessible by all parts of the process, including its threads.)
-
It might be possible for a thread to create and maintain a locally local scope unique to that thread and not shared with any other members of the process.
-
-