From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22451 invoked by alias); 11 Oct 2012 15:24:31 -0000 Received: (qmail 22440 invoked by uid 22791); 11 Oct 2012 15:24:30 -0000 X-SWARE-Spam-Status: No, hits=-2.6 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,KHOP_THREADED,RCVD_IN_HOSTKARMA_YE X-Spam-Check-By: sourceware.org Received: from smtp106.biz.mail.gq1.yahoo.com (HELO smtp106.biz.mail.gq1.yahoo.com) (98.137.12.181) by sourceware.org (qpsmtpd/0.43rc1) with SMTP; Thu, 11 Oct 2012 15:24:23 +0000 Received: (qmail 44743 invoked from network); 11 Oct 2012 15:24:23 -0000 X-Yahoo-SMTP: _6UaILCswBBhOX_6rRH7WS5y1ZaLCg-- Received: from [172.16.4.241] (jay@207.212.80.162 with plain) by smtp106.biz.mail.gq1.yahoo.com with SMTP; 11 Oct 2012 08:24:22 -0700 PDT Message-ID: <5076E4A6.2070302@systech.com> Date: Thu, 11 Oct 2012 15:24:00 -0000 From: Jay Foster Reply-To: jay@systech.com User-Agent: Mozilla/5.0 (Windows NT 5.0; rv:12.0) Gecko/20120428 Thunderbird/12.0.1 MIME-Version: 1.0 To: Allan Nielsen CC: ecos-discuss@ecos.sourceware.org References: In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact ecos-discuss-help@ecos.sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: ecos-discuss-owner@ecos.sourceware.org Subject: Re: [ECOS] Select break? X-SW-Source: 2012-10/txt/msg00010.txt.bz2 Just because eCos does not have a pipe or socketpair feature does not mean that you cannot use an additional pair of sockets. Add another socket (UDP on the loopback interface) to listen on in your select() call. Add another socket (UDP) to send messages to it using sendto(). You can bind the listening socket to the loopback interface with any port number (0) and use the getsockname() function to retrieve the actual bound socket address. This address can be used in the sendto() calls. Jay On 10/11/2012 1:51 AM, Allan Nielsen wrote: > Hi, > > Is there any way I can wakeup a select call from an other thread? > > I'm using eCos threads (not posix threads), so sending a signal using > pthread_kill does not seem to be an option. > > I would have guessed that I could create a file descriptor pair using > pipe, or socketpair, include this in the select list, and write some > dummy data. But since eCos does not implement either pipe or > socketpair, this does not seem to be an option either. > > I have tried to use the cyg_selrecord and the cyg_selwakeup functions, > but they only cause the select function to poll the file descriptors > again. > > So how can this be done using eCos threads? > > Best regards > Allan W. Nielsen > -- Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss