🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Passing info between threads

#1239
From: Lesley Anne
Date: Thu, 22 Feb 2007 23:25
42 lines
2698 bytes
"Paul at NCF" <notplmacca@clara.co.uk> wrote in message 
news:45de1d0f@newsgroups.borland.com...
>
> I may have lost the plot, but I thought you wanted to pass information to 
> a (secondary) thread from the main VCL thread (mainform)?

Yes.

> So the VCL thread is adding to the queue.

Yes.

> The thread could then get signaled and woken up, and remove the item off 
> the queue.

Yes.  That's what the HandleCommand is there for, and why it's in the 
sctpThread.


> Not sure it did.  Looked to me like the VCL thread added the command to 
> the queue, and then calls the threads handle command to take it off the 
> queue and process it?

Isn't that what you just said it should do?


> WaitForMultipleObjects would only wake up the thread when something was 
> signalled.  And it would only block the VCL thread when it was locked

But I can't have the thread sleeping or waiting or anything else that would 
keep it from processing the library's event loop.  It might be a while 
before the next time the main unit initiates an outgoing message, but in the 
meantime, the library still needs to keep looking for incoming messages.  It 
relies on sctp_eventLoop() being called continuously.  Whatever I add into 
the Execute's while loop has to co-exist peacefully with:

    while (! Terminated ) {
     if (sctp_eventLoop() < 0)
       break ;
    }

and not block that eventLoop from happening.
Technical Details
Message-ID: <45de262d$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news2.google.com!news1.google.com!news3.google.com!news4.google.com!border1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!newspeer1.nwr.nac.net!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail
References: <45d9e83a$1@newsgroups.borland.com> <h21mt21bg7maqp25d2lqkr9b1iet0eu3g6@4ax.com> <45db2486$1@newsgroups.borland.com> <vj8nt2llf7deda6ioqggci4rds885qcmne@4ax.com> <45dcc0cb@newsgroups.borland.com> <45dd557c$1@newsgroups.borland.com> <45ddf727@newsgroups.borland.com> <45de1d0f@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 11508e,234a9a04e64155b0
X-Google-Attributes: gid11508e,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Lesley Anne" <mspfila (dash) brl (at) yahoo (dot) com>
Newsgroups: borland.public.cppbuilder.internet.socket
References: <45d9e83a$1@newsgroups.borland.com> <h21mt21bg7maqp25d2lqkr9b1iet0eu3g6@4ax.com> <45db2486$1@newsgroups.borland.com> <vj8nt2llf7deda6ioqggci4rds885qcmne@4ax.com> <45dcc0cb@newsgroups.borland.com> <45dd557c$1@newsgroups.borland.com> <45ddf727@newsgroups.borland.com> <45de1d0f@newsgroups.borland.com>
Subject: Re: Passing info between threads
Date: Thu, 22 Feb 2007 18:25:09 -0500
Lines: 44
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3028
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3028
X-RFC2646: Format=Flowed; Response
NNTP-Posting-Host: 144.160.5.25
Message-ID: <45de262d$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1172186669 144.160.5.25 (22 Feb 2007 15:24:29 -0800)
Path: arc1-ca.pugleaf.net!g2news2.google.com!news1.google.com!news3.google.com!news4.google.com!border1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!newspeer1.nwr.nac.net!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail