From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,3e3949298ed3b36 X-Google-Attributes: gid103376,public Path: g2news1.google.com!news1.google.com!news.glorb.com!fu-berlin.de!uni-berlin.de!not-for-mail From: "Nick Roberts" Newsgroups: comp.lang.ada Subject: Re: High CPU in tasking Date: Thu, 24 Jun 2004 22:56:51 +0100 Message-ID: <2k1114F15uoj8U1@uni-berlin.de> References: <2k0fllF160eotU1@uni-berlin.de> X-Trace: news.uni-berlin.de z5493+lfIYCaFXaBzBwlkgW0rFr2cuxsoYxBhnwybuoAdz01Q= X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1409 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409 Xref: g2news1.google.com comp.lang.ada:1868 Date: 2004-06-24T22:56:51+01:00 List-Id: "Lutz Donnerhacke" 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