Thanks for all the replies. I mistakenly convinced myself that an object
instance belonged to a particular thread as it would if it was in
another process (space). However I realise this is not the case.

I am confused as to why you would pass messages to communicate between
threads though, could you not just update a central memory location? Or
is this because of the race condition? I think I just need to find a
real world example to put it into context.


Michael Darling
Solution Developer
ROOM Solutions Ltd
mailto:[EMAIL PROTECTED]


-----Original Message-----
From: Rob Kennedy [mailto:[EMAIL PROTECTED] 
<SNIP>

A thread can send a message to a window that belongs to another thread. 
In that case, the sending thread will wait for the receiving thread to 
handle the message and return a result.


Variables are just memory locations. They don't belong to any threads.

Two threads reading from the same memory location simultaneously is 
safe. The unsafe thing is when you have one thread writing to a memory 
location and another thread reading or writing to that same location. 
Then you have a race condition and might end up with corrupted data. 
Protect against that situation with some form of synchronization. A 
critical section is a common technique.

<SNIP>
 
--------------------------------------------------------
Room Solutions Limited is a leading supplier of solutions and services to 
non-life commercial insurance markets. Room Solutions Limited is registered in 
England and Wales with company number 2503575. Its registered office is at 100 
New Bridge Street, London EC4V 6YA, United Kingdom. 

CONFIDENTIALITY NOTICE/DISCLAIMER
This email and any attachments are confidential, protected by 
copyright/intellectual property rights and may be legally privileged. The 
information transmitted is intended only for the person or entity to which it 
is addressed. If you are not the intended recipient, dissemination or copying 
of this email is prohibited.
If you have received this in error, please notify us by forwarding this email 
to the following address: [EMAIL PROTECTED] , and then delete the email 
completely from your system.
This email and any attachments have been scanned for computer viruses by a 
market leading anti-virus system. However, it is the responsibility of the 
recipient to conduct its own security measures. No responsibility is accepted 
by ROOM Solutions Limited for loss or damage arising from the receipt or use of 
this email and any attachments.
No responsibility is accepted by ROOM Solutions Limited for personal emails.
ROOM Solutions Ltd, http://www.roomsolutions.net
--------------------------------------------------------

______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email 
______________________________________________________________________
_______________________________________________
Delphi mailing list -> [email protected]
http://www.elists.org/mailman/listinfo/delphi

Reply via email to