From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12308 invoked by alias); 12 Dec 2003 10:35:47 -0000 Mailing-List: contact ecos-discuss-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: ecos-discuss-owner@sources.redhat.com Received: (qmail 12301 invoked from network); 12 Dec 2003 10:35:46 -0000 Received: from unknown (HELO londo.lunn.ch) (80.238.139.98) by sources.redhat.com with SMTP; 12 Dec 2003 10:35:46 -0000 Received: from lunn by londo.lunn.ch with local (Exim 3.36 #1 (Debian)) id 1AUkb2-0001fu-00; Fri, 12 Dec 2003 11:32:32 +0100 Date: Fri, 12 Dec 2003 11:36:00 -0000 To: fazio@planetek.it Cc: ecos-discuss@sources.redhat.com Message-ID: <20031212103232.GB1192@lunn.ch> Mail-Followup-To: fazio@planetek.it, ecos-discuss@sources.redhat.com References: <3FD995E3.3661.52D26A5@localhost> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3FD995E3.3661.52D26A5@localhost> User-Agent: Mutt/1.5.4i From: Andrew Lunn Subject: Re: [ECOS] thread & resources lock X-SW-Source: 2003-12/txt/msg00186.txt.bz2 On Fri, Dec 12, 2003 at 10:18:11AM +0100, fazio@planetek.it wrote: > I have a doubt about resouces management used by two threads: one > thread writes a variable and the other one reads its content. Do I > have to lock the resource only when I write it or both in writing > and reading? I suggest you find a good book about multi-threaded programming and operating systems. It should cover thinks like this. You need to understand the background before you look at your specific problem. Andrew -- Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos and search the list archive: http://sources.redhat.com/ml/ecos-discuss