comp.lang.ada
 help / color / mirror / Atom feed
From: "Nick Roberts" <nick.roberts@acm.org>
Subject: Re: High CPU in tasking
Date: Thu, 24 Jun 2004 22:56:51 +0100
Date: 2004-06-24T22:56:51+01:00	[thread overview]
Message-ID: <2k1114F15uoj8U1@uni-berlin.de> (raw)
In-Reply-To: slrncdme55.brv.lutz@belenus.iks-jena.de

"Lutz Donnerhacke" <lutz@iks-jena.de> wrote in message
news:slrncdme55.brv.lutz@belenus.iks-jena.de...

> > Do you not have a separate buffer for each reader (of a single
> > demultiplexed stream)?
>
> Yep. I do have a ringbuffer with a single "writer" and an indetermined
> number of "readers". The data structure is a protected type with an entry
> family for all readers.

Would it be possible to have a separate protected object container a buffer
for each reader?

The idea is that the writer task: accepts a data packet; determines which
reader it belongs to; writes the packet into the buffer (protected object)
for this reader. This means that (in theory) different readers can be
reading in parallel with each other (and with the writer writing into a
different buffer), and it also means (hopefully) that a reader will not be
woken up unless a packet arrives that it will certainly read (not any other
reader).

If this approach is possible, I think it might more neatly solve your
problem ...

> > Also, what were the priorities of the tasks?
>
> All the same. I'm currently testing with a data source of 1GB/h and eight
> data sources of about half the rate. Each data source allocates a
ringbuffer.

... especially if you make the writer a higher priority than all the
readers.

> There are controlling tasks: A logger task writing to /dev/log, because
> syslog(3) is not thread safe, and a supervisor task for handling the
> commands on each the TCP session.

I suggest the logger task should made a lower priority than all the other
tasks (so that it tends to work in the gaps between reader and writer
activity). I suggest the supervisor task be made a higher priority than all
the other tasks, so as to minimise any delay in acting on incoming commands
(such as 'stop' ;-)

Obviously I could be grasping the wrong end of the stick here!

-- 
Nick Roberts





  reply	other threads:[~2004-06-24 21:56 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-06-24 15:43 High CPU in tasking Lutz Donnerhacke
2004-06-24 17:00 ` Nick Roberts
2004-06-24 20:25   ` Lutz Donnerhacke
2004-06-24 21:56     ` Nick Roberts [this message]
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