Still sounds like a synchronization issue.  There are lots of ways to do 
this - especially on windows - altho some methods are easier to port 
than others..

I would suggest checking into some of these (semaphores, mutexs, 
synchronize functionality, windows.postmessage etc).. an easy way is to 
setup a message queue with 'Windows.PeekMessage(TMsg,0,0,0,PM_NOREMOVE)' 
- then post a message (windows.postmessage) to the handle of the main 
form, setup a procedure in the main form to read these messages and 
update any VCL controls that are living on that form.. that way your 
worker threads don't touch them directly.  Probably one of the least 
preferred ways.. but it works ;)

Like I said, lots of ways to do it.. just depends on the application, 
how quickly you want things to respond etc.

-b

Jon Templeton wrote:
> I have more info about this problem.  I thought it was due to
> a button click but the system crashed before that.  I seems to
> crash when I move the mouse.  It doesn't matter if I move it
> within the application's form or outside of it.  I only happens
> when I'm in the TCP thread loop.  When I use RecvPacket(5000) it
> doesn't happen as often as when I use RecvPacket(500).  Also
> I took out some of my application.processmessage statements
> and it seems to take longer to crash.
> I put a do loop at the top of the thread that just has a
> sleep(1000), append text to a TMemo, and application.processmessage
> in it.  It still crashed.
> Any suggestions?
> Pat
>
> On Tue, 2007-03-27 at 23:21, Rob Schoenaker wrote:
>   
>> Sounds like a serious threading issue indeed.
>>
>> *All* things you do on VCL control from any workerthread needs to be in
>> a synchronized call. Please consult the help file on this.
>>
>> Application.ProcessMessages should not be necessary when you do you
>> looping in the worker threads.
>>
>> /Rob
>>
>> -------------------------------------------------------------------------
>> Take Surveys. Earn Cash. Influence the Future of IT
>> Join SourceForge.net's Techsay panel and you'll get the chance to share your
>> opinions on IT & business topics through brief surveys-and earn cash
>> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
>> _______________________________________________
>> synalist-public mailing list
>> [email protected]
>> https://lists.sourceforge.net/lists/listinfo/synalist-public
>>     
>
>
> -------------------------------------------------------------------------
> Take Surveys. Earn Cash. Influence the Future of IT
> Join SourceForge.net's Techsay panel and you'll get the chance to share your
> opinions on IT & business topics through brief surveys-and earn cash
> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
> _______________________________________________
> synalist-public mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/synalist-public
>
>   


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
synalist-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/synalist-public

Reply via email to