From: Lutz Donnerhacke <lutz@iks-jena.de>
Subject: Re: High CPU in tasking
Date: Fri, 25 Jun 2004 07:34:33 +0000 (UTC)
Date: 2004-06-25T07:34:33+00:00 [thread overview]
Message-ID: <slrncdnlc9.nv.lutz@taranis.iks-jena.de> (raw)
In-Reply-To: 2k1114F15uoj8U1@uni-berlin.de
* Nick Roberts wrote:
> "Lutz Donnerhacke" <lutz@iks-jena.de> wrote in message
>> > 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?
In this case, the writer has to fill an unconstraint array of ringbuffers.
This seems much more inefficient.
> The idea is that the writer task: accepts a data packet; determines which
> reader it belongs to;
Every data belongs to every reader. It's a manifolder which clones the whole
data to many receivers.
> If this approach is possible, I think it might more neatly solve your
> problem ...
The problem is solved. I published my solution to point others to this
pitfall.
>> 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.
Why? This would cause the writer to overwrite the ringbuffer without any
reading access.
>> 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' ;-)
The whole program is event triggered. There are no free running code
sequences. The only effect I can imagine will be a deadlock ;-)
next prev parent reply other threads:[~2004-06-25 7:34 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
2004-06-25 7:34 ` Lutz Donnerhacke [this message]
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