Article View: borland.public.cppbuilder.internet.socket
Article #4257Re: Servers & Backup
From: Remy Lebeau (TeamB)
Date: Wed, 09 Mar 2005 21:46
Date: Wed, 09 Mar 2005 21:46
20 lines
1700 bytes
1700 bytes
"Vladimir Stefanovic" <antivari@po.sbb.co.yu> wrote in message news:422f61a6$1@newsgroups.borland.com... > When you say *thread safe* counters/flag, do you mean > I should use critical section locks (you have shown me > once), or something else? Yes. Always provide synchronization for any memory that is shared across threads. Given the nature of the simple data types needed for counters and flags, you could use the Interlocked functions instead of a critical section. Or, you could write a separate thread that handles transfers in a queued manner, then you don't need global counters at all, and all operations are performed in 1 thread so synchronizing of the counter/flag is not needed (the queue would need to be synched, though). Gambit
Technical Details
Message-ID:
<422f6ea5$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!proxad.net!fr.ip.ndsoftware.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<422f5694@newsgroups.borland.com> <422f5ffb@newsgroups.borland.com> <422f61a6$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 11508e,1c128025d98be9a8 X-Google-Attributes: gid11508e,public X-Google-Language: ENGLISH,ASCII-7-bit From: "Remy Lebeau \(TeamB\)" <no.spam@no.spam.com> Newsgroups: borland.public.cppbuilder.internet.socket References: <422f5694@newsgroups.borland.com> <422f5ffb@newsgroups.borland.com> <422f61a6$1@newsgroups.borland.com> Subject: Re: Servers & Backup Date: Wed, 9 Mar 2005 13:46:41 -0800 Lines: 22 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: <422f6ea5$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1110404773 68.69.17.41 (9 Mar 2005 13:46:13 -0800) Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!proxad.net!fr.ip.ndsoftware.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail