Hello!
Some programs say that they are multi-process or multi-threaded.
What is the exact difference here?
On 1/18/2024 12:14 AM, Marco Moock wrote:
Hello!
Some programs say that they are multi-process or multi-threaded.
What is the exact difference here?
What about multiple multi-threaded processes? ;^)
Some programs say that they are multi-process or multi-threaded.
What is the exact difference here?
The difference is of course mostly one of semantics only ...
On 1/18/2024 2:17 PM, John Levine wrote:
According to Chris M. Thomasson <chris.m.thomasson.1@gmail.com>:
What about multiple multi-threaded processes? ;^)
You know perfectly well that's architecturally impossible. See the
previous excellent answer.
Multiple multi-threaded processes are impossible? Really? Since when...
I think John may be assuming that a CPU/core runs only one thread at a
time ... which isn't necessarily true.
Marco Moock wrote:
Hello!
Some programs say that they are multi-process or multi-threaded.
What is the exact difference here?
Welcome to comp.arch where we really love this kind of homework
questions!
The difference is of course mostly one of semantics only, where multi-threaded means that each cpu follows a single thread of
execution, working independently, whereas multi-process has a bunch
of cpus all cooperating on a single task.
Terje
On Thu, 18 Jan 2024 23:55:01 -0500, George Neuner wrote:
I think John may be assuming that a CPU/core runs only one thread at a
time ... which isn't necessarily true.
Those “hardware threads” are probably best described as “virtual CPUs”.
They have nothing to do with threads versus processes in the software
sense. They are a way of sharing functional units to make it look almost,
but not quite, like separate CPUs.
On 1/18/2024 8:55 PM, George Neuner wrote:
On Thu, 18 Jan 2024 14:28:03 -0800, "Chris M. Thomasson"
<chris.m.thomasson.1@gmail.com> wrote:
On 1/18/2024 2:17 PM, John Levine wrote:
According to Chris M. Thomasson <chris.m.thomasson.1@gmail.com>:
What about multiple multi-threaded processes? ;^)
You know perfectly well that's architecturally impossible. See the
previous excellent answer.
Multiple multi-threaded processes are impossible? Really? Since when...
I think John may be assuming that a CPU/core runs only one thread at a
time ... which isn't necessarily true.
I wonder if I missed his main point?
Though, on most systems:
Threads run in the same address space;
Processes run in different address spaces, and typically represent
different programs.
On Fri, 19 Jan 2024 13:02:26 -0600, BGB wrote:
Though, on most systems:
Threads run in the same address space;
Processes run in different address spaces, and typically represent
different programs.
The usual way of saying it is threads are “shared-everything” and >processes are (nearly) “shared-nothing”, at least by default.
On a POSIX system, you create one of the former with pthread_create(3),
and one of the latter with fork(2). But on Linux, both of these are
basically wrappers around clone(2) ><https://manpages.debian.org/2/clone.2.html>. And by using that call >directly, you get some interesting options for creating entities that are >somewhat in-between.
SVR4.2ES/MP had two versions of fork.
fork(2) would only create a single thread in the forked process
forkall(2) would create a new process with all the same threads as the
parent process.
The latter never gained any traction and when POSIX.4 came along, wasn't accepted by the standard working group.
On Fri, 19 Jan 2024 20:49:06 GMT, Scott Lurndal wrote:
SVR4.2ES/MP had two versions of fork.
fork(2) would only create a single thread in the forked process
forkall(2) would create a new process with all the same threads as the
parent process.
The latter never gained any traction and when POSIX.4 came along, wasn't
accepted by the standard working group.
Big surprise ...
Did they try to explain what the point of it was?
Hello!
Some programs say that they are multi-process or multi-threaded.
What is the exact difference here?
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 299 |
Nodes: | 16 (2 / 14) |
Uptime: | 31:47:48 |
Calls: | 6,682 |
Files: | 12,222 |
Messages: | 5,342,793 |