threadsafelog Threaded property
Return to Introduction  Previous page  Next page
Applies to
acThreadSafeLog component as subproperty of SendMail structure, acSendMail and acHTTP components.  

Declaration
property Threaded: Boolean; // False by default  

Description
The Threaded property used to choose between two working models of SendMail feature of acThreadSafeLog component.  
 
Basically there is two possible working models:  
1.Threaded: when Threaded is True, the component creates new separate thread to produce and send email message to specified SMTP host. In this case the SendMail does not locks the application interface when it connects to the SMTP server and sends the message via Internet, and only produce events synchronized with main application thread (interface).  
 
iiwarning However, in this model the component can send ONLY ONE message simultaneously, since it can create only one thread to send message. If you will try to send additional message when the component is busy, next email will not be sent, and EmailLastRecords method will just return False. You should implement some message queue to operate with SendMail in this threading model and don't call EmailLastRecords method while previous message not yet sent.  
Otherwise — set Threaded to False and use non-threaded model to send any number of email messages simultaneously from any number of different threads.  
 
2.Non-threaded: when Threaded is False, the component does not creates any separate thread to produce and send email message. This model should be used only if your application uses many threads which could send email message using this component. This model should NOT be used in single-threaded application, since when you call the EmailLastRecords method, all your application interface will be locked while the component producing and sending the email message.  

See also
EmailLastRecords method.