🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #9418

Re: Sleep() doesn't work as I'd expect

#9418
From: Chris Phillips
Date: Mon, 12 Jul 2004 09:41
24 lines
2062 bytes
If the buffer is read faster than it is written to, and frequently enough,
then it should never occur.

Experience with the application to date suggests that we don't have a
problem with losing or corrupting incoming data.
"Alan Bellingham" <alanb@episys.com> wrote in message
news:36l4f09t2v3s9mb9gf7g36pu0k7aojgpke@4ax.com...
> "Chris Phillips" <chris.phillips@corusgroup.com> wrote:
>
> >No, there are no mutexes or anything to protect the buffer. The Comms
thread
> >is the only thing writing to it (it's circular btw) and the main thread
is
> >the only thing reading from it.
>
> So how do you expect to protect the reading thread from reading a
> half-written buffer entry?
>
> _Unless_ you only have a single thread accessing the buffer, or _unless_
> every single thread is only reading it, you need some protection.
>
> Alan Bellingham
> --
> ACCU Conference 2005 - 20-23 April, Randolph Hotel, Oxford, UK
Technical Details
Message-ID: <40f25cf8$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <40eea7bc@newsgroups.borland.com> <40eeb624$1@newsgroups.borland.com> <40f24e6d@newsgroups.borland.com> <40f2522a$1@newsgroups.borland.com> <40f252c7@newsgroups.borland.com> <36l4f09t2v3s9mb9gf7g36pu0k7aojgpke@4ax.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,f4373c97b27dc766
X-Google-Attributes: gid10cc67,public
X-Google-Language: ENGLISH,ASCII-7-bit
Reply-To: "Chris Phillips" <chris.phillips@corusgroup.com>
From: "Chris Phillips" <chris.phillips@corusgroup.com>
Newsgroups: borland.public.cppbuilder.nativeapi
References: <40eea7bc@newsgroups.borland.com> <40eeb624$1@newsgroups.borland.com> <40f24e6d@newsgroups.borland.com> <40f2522a$1@newsgroups.borland.com> <40f252c7@newsgroups.borland.com> <36l4f09t2v3s9mb9gf7g36pu0k7aojgpke@4ax.com>
Subject: Re: Sleep() doesn't work as I'd expect
Date: Mon, 12 Jul 2004 10:41:15 +0100
Lines: 26
Organization: Corus
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.50.4922.1500
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4939.300
NNTP-Posting-Host: 145.8.171.20
Message-ID: <40f25cf8$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1089625336 145.8.171.20 (12 Jul 2004 02:42:16 -0700)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail