Article View: borland.public.cppbuilder.nativeapi
Article #2772Re: TCriticalSection between 2 threads
From: Eelke
Date: Tue, 28 Nov 2006 11:24
Date: Tue, 28 Nov 2006 11:24
19 lines
1672 bytes
1672 bytes
Boba wrote: > "Eelke" <e.klein@remove.mplussoftware.nl> wrote in message > news:456c0cd1@newsgroups.borland.com... >> ... >> Actually for trivial data like a single integer no critical section is >> needed because the assignment of an int is an atomic operation. > > and what do you call an 'atomic operation' ? > > An atomic operation is an operation which is executed completely before another thread can see the result of the operation. For instance the assignment of an int is atomic because the CPU changes all 32-bits at the same time so another thread sees either the old value or the new but never some combination. This is only true when the data is properly aligned. Eelke
Technical Details
Message-ID:
<456c1c40$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news2.google.com!news1.google.com!news3.google.com!news.glorb.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mailReferences:
<456bfb16@newsgroups.borland.com> <456c0cd1@newsgroups.borland.com> <456c1747@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,2ab3d3cded5b6fe1 X-Google-Attributes: gid10cc67,public X-Google-Language: ENGLISH,ASCII-7-bit Date: Tue, 28 Nov 2006 12:24:39 +0100 From: Eelke <e.klein@remove.mplussoftware.nl> User-Agent: Thunderbird 1.5.0.8 (Windows/20061025) MIME-Version: 1.0 Newsgroups: borland.public.cppbuilder.nativeapi Subject: Re: TCriticalSection between 2 threads References: <456bfb16@newsgroups.borland.com> <456c0cd1@newsgroups.borland.com> <456c1747@newsgroups.borland.com> In-Reply-To: <456c1747@newsgroups.borland.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit NNTP-Posting-Host: 195.241.133.37 Message-ID: <456c1c40$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1164713024 195.241.133.37 (28 Nov 2006 03:23:44 -0700) Lines: 19 Path: arc1-ca.pugleaf.net!g2news2.google.com!news1.google.com!news3.google.com!news.glorb.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail