Hi,
While in 2012 spinning was absolute no go,
reflecting somehow the economic mantra
of rationalization:
?I want to say, in all seriousness, that a
great deal of harm is being done in the
modern world by belief in the virtuousness
of work, and that the road to happiness
and prosperity lies in an organised
diminution of work.?
-- Bertrand Russell, In Praise of Idleness
My work premis on the other hand, is challenging
the root assumption behind the economic mantra,
which is scarce resources. We can see the GPU
as a device that provides a place for slacking
at the workplace, lifting procrastination to
the status of working:
I'm a spinner, I'm a sinner
I spin on CAS loops for my dinner
Some call it busy-wait, I call it fate
When the queue is empty, I just rotate
Bye
Mild Shock schrieb:
Hi,
One core problem in the design of algorithms
for a large number of cores, such as found in a
GPU, and in general, is the fact, that parking
is most often more expensive than spinning.
So if you have short wait times or few waiters ,
the cost model looks favorable if you use
spinning, versus the same thing implemented
with parking. The Java libraries by Doug Lea found
in java.concurrency go even that far to use hybrid
algorithms, that use spinning and parking. I guess
its pretty easy, you just do backoff by using parking.
Bye
Mild Shock schrieb:
Hi,
The clever soluton by Dmitry Vyukov shows
that the monitor is not necessarily canonical, when
we allow spinning. But spinning sometimes runs
counter to what we expect an operating system
respectively a language runtime does with processes
and threads, namely they are parked.
The absense of parking in GPU can now give the
false impression, that spinning is not allowed.
But why did Dmitry Vyukov develop his solution,
and had a website called 1000 cores? Because
with a large number of cores and certain systolic
payloads, i.e. always enough work for all threads,
the operating systems model of 2000 threads being
parked, this requirement can severly be challenged,
and allows a fundamental rethinking.
Bye
Mild Shock schrieb:
Hi,
Understanding the difference between Queue and Mutex?
Mutex: A single binary semaphore
Queue: A condition to signal non empty
˙˙˙˙˙˙˙ A condition to signal non full
˙˙˙˙˙˙˙ A monitor for the critical section
Monitors were invented by Per Brinch Hansen
and C. A. R. Hoare. Although the critical section
could be modelled by a simple mutex,
The condition wait has to leave the critical
section temporarily, so the conditions sit on
the monitor mutex. So who is the biggest moron?
Well Chris M. Thomasson, I already talk like
for one month, about the need for bounded queues,
but all he can present recently was some
C code for a spin backoff mutex?
Bye
Mr. Man-wai Chang schrieb:
What is a genius programmer?
--- PyGate Linux v1.5.19
* Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)