🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.internet.socket
Article #5102

Re: Indy AThread Question

#5102
From: James
Date: Sun, 17 Oct 2004 22:14
41 lines
2064 bytes
Thanks for the response.

So a better way would perhaps be to store the OnExecute thread's thread id, 
and then send the OnExecute thread a 'thread message' (from my secondary 
thread) which it could pick up and send using AThread?

Would that avoid the problem?

And how many times can we use the word "thread" in a sentence? :-)

Thanks again,

- James


"Remy Lebeau (TeamB)" <no.spam@no.spam.com> wrote in message 
news:4172b877$1@newsgroups.borland.com...
>
> "James" <jb9@btinternet.com> wrote in message
> news:417256cf$1@newsgroups.borland.com...
>
>> Is AThread threadsafe?
>
> No.
>
>> Obviously there's a chance that the TCPServer's OnExecute
>> thread might try to send/receive data with the AThread, at the
>> same time as my other thread is using it to send data.
>>
>> Is this a problem?
>
> Yes.  Multiple threads cannot both read from the socket at the same time, 
> or
> both write to the socket at the same time.  They will step over each 
> other.
> You will have to provide some kind of synching to prevent that.
>
>
> Gambit
>
> 
Technical Details
Message-ID: <4172eeb4$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!proxad.net!proxad.net!easynet-quince!easynet.net!colt.net!peernews3.colt.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <417256cf$1@newsgroups.borland.com> <4172b877$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 11508e,67c4133e59baab76
X-Google-Attributes: gid11508e,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "James" <jb9@btinternet.com>
Newsgroups: borland.public.cppbuilder.internet.socket
References: <417256cf$1@newsgroups.borland.com> <4172b877$1@newsgroups.borland.com>
Subject: Re: Indy AThread Question
Date: Sun, 17 Oct 2004 23:14:13 +0100
Lines: 43
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
X-RFC2646: Format=Flowed; Original
NNTP-Posting-Host: 217.42.177.106
Message-ID: <4172eeb4$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1098051252 217.42.177.106 (17 Oct 2004 15:14:12 -0700)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!proxad.net!proxad.net!easynet-quince!easynet.net!colt.net!peernews3.colt.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail