469,290 Members | 1,941 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,290 developers. It's quick & easy.

question on multithreading, pipes


I have written a script which is performing some tasks in
multithreading mode: the main thread is opening a connection to a
distant server and all the threads that I start will have to perform
actions on the remote server using the connection initiated by the main
thread. At first sight, the only way I could achieve that in a proper
manner (ie without having to open a connection to the remote server in
every single thread and close it at the end of the thread) would be to
use a pipe that I would use in all the threads, for example:
* main thread:
fw, fr = os.popen2('/bin/ksh')
* other threads:
fw.write('perform action')

but if I do that, I need to queue the events, which means I have to
serialize the jobs perform by the threads, which is clearly not what I
want as I am using threads :-)
so my question is: how could I get around this without giving up
multithreading ?
any help appreciated.

Jul 18 '05 #1
0 1238

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Christian Hammers | last post: by
1 post views Thread by dixp | last post: by
9 posts views Thread by Hans J?rg Brinksmeyer | last post: by
2 posts views Thread by Rich | last post: by
7 posts views Thread by Ray | last post: by
3 posts views Thread by ZhukovL | last post: by
1 post views Thread by dgk | last post: by
7 posts views Thread by andrewb | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.