Hi Noam

...definitely no need to synchronize in a "single threaded app".

Multi threaded:
Main thread: Just add content to TMemo
Other threads: Use synchronize (Executes a method call within the main thread)
http://docwiki.embarcadero.com/Libraries/XE2/en/System.Classes.TThread.Synchronize

Regards
Michael

----- Original Message ----- From: "Noam weissman" <n...@silrd.com>
To: "ICS support mailing" <twsocket@lists.elists.org>
Sent: Wednesday, February 26, 2014 9:49 AM
Subject: Re: [twsocket] Multiple TCp clients


Hi,

OK...

Make sense but if you have a few TWSocets running at the same time
and from every connection writing to a shared TMemo you do not
need to synchronize it somehow ?

OK, maybe my problem was different.

Thanks for elaborating this.

BR,
Noam.



-----Original Message-----
From: TWSocket on behalf of François Piette
Sent: Tue 2/25/2014 10:41 PM
To: 'ICS support mailing'
Subject: Re: [twsocket] Multiple TCp clients

Can you please explain "there is definitely no such issue" ?
I had a problem similar to this:
I had a thread sending ping's to a list of IP's to check if devices are
online.

Please read again what I said: His program isn't multithreaded.

If you use threads, then you can NOT acces any GUI item - such as a TMemo -
from your thread. VCL is not "thread safe".

I was told by a friend that the reason for that happening is that window
is not an RT OS and will time slice the operation.

This is not related at all to a real time operating system or not.

Am I missing here something ?

I don't know. Maybe you forgot that TWSocket component multitask without
using threads. It simply uses events. And as such don't need to use
synchronization objects. Of course if you use TWSocket in a thread, you are
back to the difficulties of multithreading. And you may actually built a
slower application to make a long story short.

--
francois.pie...@overbyte.be
Embarcadero MVP
http://www.overbyte.be
http://francois-piette.blogspot.com






--
To unsubscribe or change your settings for TWSocket mailing list
please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be



************************************************************************************
This footnote confirms that this email message has been scanned by
PineApp Mail-SeCure for the presence of malicious code, vandals & computer viruses.
************************************************************************************







************************************************************************************
This footnote confirms that this email message has been scanned by
PineApp Mail-SeCure for the presence of malicious code, vandals & computer viruses.
************************************************************************************



--
To unsubscribe or change your settings for TWSocket mailing list
please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be
--
To unsubscribe or change your settings for TWSocket mailing list
please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be

Reply via email to