From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4398 invoked by alias); 8 Nov 2009 18:40:00 -0000 Received: (qmail 4388 invoked by uid 22791); 8 Nov 2009 18:39:59 -0000 X-SWARE-Spam-Status: No, hits=-2.6 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: sourceware.org Received: from smtp-out.google.com (HELO smtp-out.google.com) (216.239.33.17) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sun, 08 Nov 2009 18:39:52 +0000 Received: from wpaz24.hot.corp.google.com (wpaz24.hot.corp.google.com [172.24.198.88]) by smtp-out.google.com with ESMTP id nA8IdmQt032068 for ; Sun, 8 Nov 2009 18:39:49 GMT Received: from yxe14 (yxe14.prod.google.com [10.190.2.14]) by wpaz24.hot.corp.google.com with ESMTP id nA8IdkYZ011979 for ; Sun, 8 Nov 2009 10:39:46 -0800 Received: by yxe14 with SMTP id 14so2246539yxe.7 for ; Sun, 08 Nov 2009 10:39:46 -0800 (PST) Received: by 10.150.236.17 with SMTP id j17mr11733464ybh.229.1257705586042; Sun, 08 Nov 2009 10:39:46 -0800 (PST) Received: from coign.google.com (adsl-71-133-8-30.dsl.pltn13.pacbell.net [71.133.8.30]) by mx.google.com with ESMTPS id 4sm758065ywi.57.2009.11.08.10.39.44 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sun, 08 Nov 2009 10:39:45 -0800 (PST) To: mohsen@pahlevanzadeh.org Cc: gcc@gcc.gnu.org Subject: Re: link list & thread References: <1257716053.8665.3.camel@debian> From: Ian Lance Taylor Date: Sun, 08 Nov 2009 18:40:00 -0000 In-Reply-To: <1257716053.8665.3.camel@debian> (Mohsen Pahlevanzadeh's message of "Mon\, 09 Nov 2009 01\:04\:13 +0330") Message-ID: User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-System-Of-Record: true X-IsSubscribed: yes Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org X-SW-Source: 2009-11/txt/msg00206.txt.bz2 Mohsen Pahlevanzadeh writes: > I have a thread & 2 func.flush_2_db() is in thread & add_element() is > outside of thread. > add_element's job is adding data to link list.& flush_2_db()'s job is > reading list & drop from list.But my problem is override data & lost > data, because flush_2_db is in the thread & both work parallel. > Do you have any idea for solving my problem? This question is not appropriate for the gcc@gcc.gnu.org mailing list. This is a general programming question and has nothing to do with gcc. Please ask on a general programming forum. Ian