From: Lutz Donnerhacke <lutz@iks-jena.de>
Subject: High CPU in tasking
Date: Thu, 24 Jun 2004 15:43:46 +0000 (UTC)
Date: 2004-06-24T15:43:46+00:00 [thread overview]
Message-ID: <slrncdltli.nr.lutz@taranis.iks-jena.de> (raw)
In order to stop others falling into the same mistake, I debugged several
days.
I wrote an data stream decoder and output (via TCP) manifolder using Ada
tasking and a protected ringbuffer. The whole application word fine, but the
CPU load increased linear on input load and dramatically over the number of
output queues.
Debugging turned out:
- Every writing to the ringbuffer wakes up all reader tasks.
- That's why the reader buffers were filled with only the little data amount
just written.
- Tasking overhead caused the CPU load.
Two solutions (used both):
- The ringbuffer got a minimum reading length => Fewer wakeups.
- The writer task collect a lot of data before writing
=> Fewer checks for wakeup.
The ratio of tasking events before and after the change is about 30:1.
Conclusion:
When implementing tasking synchonisation with protected objects,
keep in mind, that the standard Ada tasking model generates a near real
time experience, which is mostly not required.
HTH
next reply other threads:[~2004-06-24 15:43 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-06-24 15:43 Lutz Donnerhacke [this message]
2004-06-24 17:00 ` High CPU in tasking Nick Roberts
2004-06-24 20:25 ` Lutz Donnerhacke
2004-06-24 21:56 ` Nick Roberts
2004-06-25 7:34 ` Lutz Donnerhacke
2004-06-25 17:03 ` Nick Roberts
2004-06-28 8:32 ` Lutz Donnerhacke
2004-06-29 17:26 ` Nick Roberts
2004-06-30 12:26 ` Lutz Donnerhacke
2004-06-30 23:39 ` Randy Brukardt
2004-07-01 7:02 ` Lutz Donnerhacke
2004-06-25 21:15 ` Mark Lorenzen
2004-06-26 8:01 ` Wojtek Narczynski
2004-06-28 8:17 ` Lutz Donnerhacke
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox