Author | Topic: Sockets and Threads | |
---|---|---|
Jose Adriano Baltieri | Sockets and Threads on Fri, 07 Dec 2001 10:50:57 -0200 Is there any problem on mixing sockets with threads ? That is, having a socket being operated by more than one thread. What if this operation occurs simultaneously (bad idea) ? Or, I'd better have a "one thread only operates on a socket per time" model ? TIA ! -- Obrigado/Thanks a Lot, Jose Adriano Baltieri Analista de Sistemas/Systems Analyst CPD - CENTRO / Data Processing Dept UNIMEP - Universidade Metodista de Piracicaba/ UNIMEP - Methodist University of Piracicaba PIRACICABA - SP - BRASIL Fone : 055 0 XX 19 3124-1858 (english spoken) Fax : 055 0 XX 19 3124-1898 (cx postal 42778) | |
Andreas Herdt | Re: Sockets and Threads on Tue, 11 Dec 2001 09:31:14 +0100 Hi, Sockets are process local. This means they may be used by more then one thread. No problem. You are right. Using a socket from more than one thread simultaniously is a very bad idea. You should protect the sockets from such an occurance. Please read the docu according threads, process and sync. Best regards -- Andreas Herdt Alaska Software Technology AG ------------------------------------------------------------- Technical Support EMEA: mailto:support@de.alaska-software.com Technical Support APRA: mailto:support@us.alaska-software.com News Server: news://news.alaska-software.com Homepage: http://www.alaska-software.com ------------------------------------------------------------- "Jose Adriano Baltieri" <jabaltie@unimep.br> schrieb im Newsbeitrag news:3C10BB31.1BD6FCDF@unimep.br... > > Is there any problem on mixing sockets with threads ? That is, > having a socket being operated by more than one thread. What if this > operation occurs simultaneously (bad idea) ? Or, I'd better have a "one > thread only operates on a socket per time" model ? > > TIA ! > -- > > > Obrigado/Thanks a Lot, > > Jose Adriano Baltieri > Analista de Sistemas/Systems Analyst > CPD - CENTRO / Data Processing Dept > UNIMEP - Universidade Metodista de > Piracicaba/ > UNIMEP - Methodist University of > Piracicaba > PIRACICABA - SP - BRASIL > Fone : 055 0 XX 19 3124-1858 (english > spoken) > Fax : 055 0 XX 19 3124-1898 (cx postal > 42778) > > |