|
The UKHA-ARCHIVE IS CEASING OPERATIONS 31 DEC 2024
|
|
[Date Prev][Date
Next][Thread Prev][Thread Next][Date
Index][Thread Index]
Re: Re: Spare server...
>Paul
>Are you sure that multi-threaded apps are distributed across
>processors by thread? My understanding is that it is _processes_,
not
>_threads_, that are distributed across processors in a multi-
>processor environment, but then again, given your intimate
knowledge
>of the MS world I could be on dodgy ground!
>
>Patrick
>
Reasonably sure... but as with anything MS no-one *really* knows the truth
of whats going on under there!...
However, it is my understanding that the OS can and will schedule any
*thread* to any available processor, and it will do this dynamically and
automatically. However, you *can* restrict threads to one (or more)
processor to improve processor cache hits.
Naturally though, it's never "quite" as straightforward as
that...
Applications, although multi-threaded, also need to be optimised for
asynchronous execution.
Quote from MS Knowledgebase:
"Windows 2000 uses a soft affinity algorithm that favours running a
thread
either on the last processor that serviced it or its ideal processor, a
processor associated with a thread with a default value assigned by the
system or optionally specified by the program developer in the application
code. Affinity is the mechanism for associating threads of a process with a
processor. With soft affinity, the association can vary between different
processors; with hard affinity, the association is fixed to a set of one or
more processors. In general, soft affinity is an optimal design that takes
advantage of cache locality. However, when threads migrate from one
processor to another processor, memory access to previously cached data may
be slower. At worst, thread migration might cause false sharing because, to
the cache coherency hardware of the CPU, it might appear that multiple
processors are sharing a cache line."
Paul G.
Ooh, by the way, did you know that there's an even *smaller* scheduling
unit
than a thread!! - there are "fibers" as well.. only used by a few
apps (SQL
7 being one), where a single thread runs on each CPU, that manages fibers
within the thread...
How sad am I??
:-)
_________________________________________________________________
Home |
Main Index |
Thread Index
|
|