From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6580 invoked by alias); 21 Jun 2006 07:22:02 -0000 Received: (qmail 6567 invoked by uid 22791); 21 Jun 2006 07:22:01 -0000 X-Spam-Check-By: sourceware.org Received: from mxout02-esl-se-cyg.cygrids.net (HELO mxout02-esl-se-cyg.cygrids.net) (85.118.200.137) by sourceware.org (qpsmtpd/0.31) with ESMTP; Wed, 21 Jun 2006 07:21:56 +0000 Received: from era.faiveley.com (smtp.faiveley.fr [194.3.149.193]) by mxout02-esl-se-cyg.cygrids.net (Cygrids SMTP Service) with ESMTP id EB9752E5F02 for ; Wed, 21 Jun 2006 09:22:03 +0200 (CEST) Received: by smtp.faiveley.fr(Lotus SMTP MTA v4.6.3 (778.2 1-4-1999)) id C1257194.00286EFE ; Wed, 21 Jun 2006 09:21:38 +0200 X-Lotus-FromDomain: FAIVELEY From: e.coullien@faiveley.com To: Andrew Lunn cc: ecos-discuss@ecos.sourceware.org Message-ID: Date: Wed, 21 Jun 2006 07:22:00 -0000 Mime-Version: 1.0 Content-type: text/plain; charset=us-ascii Content-Disposition: inline X-IsSubscribed: yes Mailing-List: contact ecos-discuss-help@ecos.sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: ecos-discuss-owner@ecos.sourceware.org Subject: [ECOS] =?iso-8859-1?Q?R=E9f._:_Re:_[ECOS]_Question_on_Posix_Select_funct?= =?iso-8859-1?Q?ion?= X-SW-Source: 2006-06/txt/msg00197.txt.bz2 1) Our Instrument package stores Timebase, Events code, thread and 2 arguments and compress each frame and store the frame in a buffer, then when the buffer reach 1500 oct, it sends the buffer on Ethernet. This allow to reduce the number of instrument event. We don't use the Redboot network stack because the PC software need to control the instrument package on the board in real time. For exemple, during the run, we can start or stop the trace, change events filter or we can ask the name and priority of each thread. 2) Thank you for your answer but we don't have the SELECT_WAIT_FLAG_GET() macro because our eCos PRO is too old. In fact, it seems to work with just one mutex. We are going to update our eCos soon. Thank you, Emmanuel Coullien Andrew Lunn le 20/06/2006 12:33:59 Pour Emmanuel COULLIEN/Faiveley : cc : ecos-discuss@ecos.sourceware.org Objet Re: [ECOS] Question on Posix Select function : On Mon, Jun 19, 2006 at 11:17:42AM +0200, e.coullien@faiveley.com wrote: > > > We are working on a package to complete the eCos Intrument package > for communicating with a PC software through Ethernet. The goal is > to record in real time the Instrument informations from the board to > the PC and to watch a graph to show tasks and other instrument > traces. Interesting. How do you solve the obvious race condition that using the network to send the events generate events? Ideally you should use the RedBoot network stack for this. > We began to graph a module with a SELECT function but we have some > difficulties to understand what we see on the Graph. In a task, > before sending, we call the select function. In fact the task which > calls the SELECT function is switching on even if the driver is not > ready to send. So the graph shows that this task is active very > often instead to sleep until the driver is ready to send. Do > someone know how to explain this phenomenon and how does the Posix > select function really work ? There is pritty good comments in the code. Have you read them: // A flag is used to block a thread until data from the device is // available. This prevents all threads from waking up at the same // time and polling for changes. Each thread is allocated a flag bit // via the SELECT_WAIT_FLAG_GET() macro when the thread registers for // selection via cyg_selrecord (). The flag is stored in the driver's // select info block. Only those threads specified via the flags in // the select info are woken up by cyg_selwakeup (). If there are // more than 32 threads in the system, then there is a chance that // cyg_selwakeup () may wake up more than one thread. Each thread then // polls for changes. So you probably have the same bit set as some other thread using the network. Andrew -- Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss