Re: APARTMENTTHREADED vs MULTITHREADED - WeOnlyDo Discussion board

Re: APARTMENTTHREADED vs MULTITHREADED (General questions)

by Silverio, Thursday, July 01, 2010, 15:04 (5257 days ago) @ woddrazen


wodVPN is thread safe, but you need to have it in apartment threaded.

Which means that the component has to be used from the same thread that it was instantiated from.

Uhm, thread safe, this is a good news.
I've leaved the MTE envirorment for the STE (many changes to my code).

At this point however all wodVPN objects are created and stored in a TThreadList by main program thread and used each one by a only TIdTCPServer connection thread (TIdPeerThread). This break what you wrote upon the component has to be used from the same thread that it was instantiated from but I hope this don't generate any fault in the system. If the using thread MUST to be the only creating wodVPN object thread I will need to change again my code.

Unfortunately I'm very bad in OLE/COM knowledge so my project draft suffer of missing knowledge about this matter :(

Cross my fingers...


Complete thread: