Article View: borland.public.cppbuilder.nativeapi
Article #7731Using InterlockedXXX family functions
From: Tumurbaatar S.
Date: Thu, 23 Dec 2004 06:39
Date: Thu, 23 Dec 2004 06:39
12 lines
1410 bytes
1410 bytes
Hello! My program is 2-threaded and there's a shared variable. The variable is something like a performance counter. One thread constantly (about 20..50 times per second) modifies (increments) this variable's value and the second thread periodically (every 2..10 second) reads its value and resets it to zero. Instead of using a critical section, I use InterlockedXXX() functions. But I have to use these functions only in one thread (probably in the 2nd thread, because it access the shared variable rarely) or in both threads? Thank you!
Technical Details
Message-ID:
<41ca6807@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!proxad.net!gatel-ffm!gatel-ffm!194.25.134.126.MISMATCH!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,d3bc4ea7bb23fd1c,start X-Google-Attributes: gid10cc67,public X-Google-Language: ENGLISH,ASCII-7-bit From: "Tumurbaatar S." <nospam_tumur@magicnet.mn> Newsgroups: borland.public.cppbuilder.nativeapi Subject: Using InterlockedXXX family functions Date: Thu, 23 Dec 2004 14:39:04 +0800 Lines: 14 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.2527 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2527 X-RFC2646: Format=Flowed; Original NNTP-Posting-Host: 202.131.2.6 Message-ID: <41ca6807@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1103783943 202.131.2.6 (22 Dec 2004 22:39:03 -0800) Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!proxad.net!gatel-ffm!gatel-ffm!194.25.134.126.MISMATCH!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail