Re: OnExecute updating a Form

Giganews Newsgroups
Subject: Re: OnExecute updating a Form
Posted by:  Jack Mays (jackma…
Date: Wed, 02 Jul 2003

anomalous wrote:
> A question about the Chat Room demo:  part of the tcpServerExecute method
> includes a call to UpdateClientList.  since this function updates a listbox
> on the main form, shouldnt this be done through a Synchronize?

Yes, or by using other synchronize methods.

>  if not, why
> is it ok to do this - i thought OnExecute was called in the context of the
> thread connected to that particular client...

It's not ok to do that as a dead-lock or worse may occur.  The onExecute
does run in the context of the client thread so if you have little
processing to do it would be easier to just have all your code there.


In response to

OnExecute updating a Form posted by anomalous on Wed, 2 Jul 2003