Article View: borland.public.cppbuilder.nativeapi
Article #7559Re: Accessing same variable from multiple threads
From: Remy Lebeau (TeamB)
Date: Wed, 19 Jan 2005 21:38
Date: Wed, 19 Jan 2005 21:38
19 lines
1945 bytes
1945 bytes
"Vladimir Afanasyev" <avv@systema.kiev.ua> wrote in message news:41eeaff9$1@newsgroups.borland.com... > For example, thread must read value in 10:00 but just before > this time dispatcher pass control to another thread. So > variable was read in 10:00:00.20 but another thread made > changes in 10:00:00.10. If first thread read it in time > (10:00:00.00) it read before value but in above case it > read after value. The critical section can't help in this case. Yes, it does, because it guarantees that the reading thread cannot even begin to read the value until after the writing thread is completely finished changing it. Vice versa, it also guarantees that the writing thread cannot even begin to change the value until the reading thread is completely finished reading it. Gambit
Technical Details
Message-ID:
<41eed2d5$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!proxad.net!proxad.net!194.159.246.34.MISMATCH!peer-uk.news.demon.net!kibo.news.demon.net!demon!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<41edea6b@newsgroups.borland.com> <41ee3727$1@newsgroups.borland.com> <41ee742e$1@newsgroups.borland.com> <41ee8f57$1@newsgroups.borland.com> <qu9tu0hgv4gqnlvv65nqq70ua4v73jv0mu@4ax.com> <41eeaff9$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,4809cdd9a7828fa7 X-Google-Attributes: gid10cc67,public X-Google-Language: ENGLISH,ASCII-7-bit From: "Remy Lebeau \(TeamB\)" <no.spam@no.spam.com> Newsgroups: borland.public.cppbuilder.nativeapi References: <41edea6b@newsgroups.borland.com> <41ee3727$1@newsgroups.borland.com> <41ee742e$1@newsgroups.borland.com> <41ee8f57$1@newsgroups.borland.com> <qu9tu0hgv4gqnlvv65nqq70ua4v73jv0mu@4ax.com> <41eeaff9$1@newsgroups.borland.com> Subject: Re: Accessing same variable from multiple threads Date: Wed, 19 Jan 2005 13:38:37 -0800 Lines: 21 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1409 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409 NNTP-Posting-Host: 68.69.17.41 Message-ID: <41eed2d5$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1106170581 68.69.17.41 (19 Jan 2005 13:36:21 -0800) Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!proxad.net!proxad.net!194.159.246.34.MISMATCH!peer-uk.news.demon.net!kibo.news.demon.net!demon!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail