From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29742 invoked by alias); 2 Aug 2005 15:27:32 -0000 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 Received: (qmail 29721 invoked by uid 22791); 2 Aug 2005 15:27:26 -0000 Received: from londo.lunn.ch (HELO londo.lunn.ch) (80.238.139.98) by sourceware.org (qpsmtpd/0.30-dev) with ESMTP; Tue, 02 Aug 2005 15:27:26 +0000 Received: from lunn by londo.lunn.ch with local (Exim 3.36 #1 (Debian)) id 1DzyhE-0001Xo-00; Tue, 02 Aug 2005 17:28:48 +0200 Date: Tue, 02 Aug 2005 15:27:00 -0000 To: "R. Vamshi Krishna" Cc: ecos-discuss@ecos.sourceware.org Message-ID: <20050802152848.GK1057@lunn.ch> Mail-Followup-To: "R. Vamshi Krishna" , ecos-discuss@ecos.sourceware.org References: <42EF88BB.6060804@cse.iitb.ac.in> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <42EF88BB.6060804@cse.iitb.ac.in> User-Agent: Mutt/1.5.9i From: Andrew Lunn Subject: Re: [ECOS] Problem in program :: Please Help X-SW-Source: 2005-08/txt/msg00020.txt.bz2 On Tue, Aug 02, 2005 at 08:22:43PM +0530, R. Vamshi Krishna wrote: > Hello all, > > I am stuck up at a problem. This is what I wanted to do :: > > 1. An application runs in two different modes. > 2. Each mode has 3 threads (distinct). > 3. The application must switch modes at every 1000 ticks. > 4. The individual threads of a mode will execute periodically. > > 5. I have tried to use an alarm to indicate that 1000 ticks are over. > 6. Also each thread has its own alarm to indiacte that that it's > period is over. > > Where have I gone wrong ?? Lots.... First of you are doing things in an alarm function you are not allowed to do. See the documentation. Secondly as the documentation says, you should only call cyg_thread_delete on a thread that as existed. The strucuture you currently have is very unsafe. I suggest you throw away your current design and start again with something more sain. 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