comp.lang.ada
 help / color / mirror / Atom feed
From: "Nick Roberts" <nickroberts@callnetuk.com>
Subject: Context switching (was: delay until and GNAT)
Date: 1999/05/10
Date: 1999-05-10T00:00:00+00:00	[thread overview]
Message-ID: <3736e102@eeyore.callnetuk.com> (raw)
In-Reply-To: 7h1e10$drg$1@nnrp1.deja.com

I'd just to add a little note on context switching.

[:1:]  On some processors, a 'fast' context switch can be achieved in just a
few CPU clock cycles (by simply switching register banks), which, on a
modern 'RISC' processor, could equate to a mere few picoseconds.  In
practice, obviously, this is a facility likely to be used only in HRT
embedded systems, or for fundamental system software only.

[:2:]  Many processor architectures today provide built-in support for
(normal) context switching, so that the operating system will usually have
very little to do with the speed of these context switches.  Switches can
generally be achieved within a few dozen memory clock cycles (typically
out-of-cache), which will be, for most modern microcomputers, in the
ballpark of 1 microsecond (+/-1oom).

[:3:]  Some operating systems (naming no names ;-) are amazingly slow at
context switches, taking many thousands of instructions to achieve just one
switch.

If you can get access to a high-resolution system clock from within a
compiled program, you can easily test the performance of a particular
system.  Try running under different loading conditions: 1 task; 10 tasks;
100 tasks; 1000 tasks.  (You may find the 1000 trial goes kerplunk.)  Come
to think of it, I might write a little Ada program to do this and post it on
comp.lang.ada for fun!

-------------------------------------
Nick Roberts
-------------------------------------








  parent reply	other threads:[~1999-05-10  0:00 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-05-05  0:00 delay until and GNAT isaac buchwald
1999-05-05  0:00 ` David C. Hoos, Sr.
1999-05-05  0:00 ` dennison
1999-05-06  0:00   ` Buz Cory
1999-05-06  0:00     ` Robert Dewar
1999-05-06  0:00       ` delay until and GNAT - expand isaac buchwald
1999-05-07  0:00         ` Roger Racine
1999-05-08  0:00           ` dewar
1999-05-10  0:00             ` Roger Racine
1999-05-11  0:00               ` Robert Dewar
1999-05-11  0:00                 ` dennison
1999-05-11  0:00                   ` Robert Dewar
1999-05-12  0:00                 ` delay until and GNAT - where to get the info isaac buchwald
1999-05-12  0:00                   ` Robert Dewar
1999-05-10  0:00             ` Nick Roberts [this message]
1999-05-11  0:00               ` Context switching (was: delay until and GNAT) Robert Dewar
1999-05-11  0:00               ` Robert Dewar
1999-05-11  0:00                 ` Tarjei Tj�stheim Jensen
1999-05-11  0:00                   ` David Brown
1999-05-11  0:00                   ` Robert Dewar
1999-05-10  0:00             ` delay until and GNAT - expand Roger Racine
1999-05-10  0:00               ` Joel Sherrill
1999-05-11  0:00               ` Robert Dewar
1999-05-11  0:00                 ` dennison
1999-05-11  0:00               ` isaac buchwald
1999-05-11  0:00                 ` dennison
1999-05-12  0:00                 ` Robert Dewar
     [not found]             ` <rracine.14.00 <rracine.15.000968A0@draper.com>
1999-05-11  0:00               ` Robert Dewar
1999-05-11  0:00             ` Roger Racine
1999-05-12  0:00             ` Roger Racine
     [not found]             ` <rracine.14.00 <rracine.17.0007DA28@draper.com>
1999-05-12  0:00               ` dennison
1999-05-06  0:00 ` delay until and GNAT Roger Racine
1999-05-10  0:00   ` Nick Roberts
1999-05-11  0:00     ` Context Switching Nick Roberts
1999-05-11  0:00       ` Robert Dewar
1999-05-11  0:00         ` Robert I. Eachus
1999-05-12  0:00           ` dennison
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox