473,511 Members | 15,302 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

distributed queue?

Does anyone have an implementation of a distributed queue? I.e. I
have a long running computation f(x) and I'd like to be able to
evaluate it (for different values of x) on a bunch of different
computers simultaneously, the usual "worker thread" pattern except
distributed across a network. I guess this is pretty easy to write
with a centralized socket listener that dispatches requests through a
Queue to multiple threads on the same machine, each talking
synchronously to a server socket. I wonder if something like it
already exists. I see a little bit of discussion in the newsgroup
archive but no obvious pointers to code.

Thanks.
Mar 10 '07 #1
9 1742
Paul Rubin wrote:
Does anyone have an implementation of a distributed queue? I.e. I
have a long running computation f(x) and I'd like to be able to
evaluate it (for different values of x) on a bunch of different
computers simultaneously, the usual "worker thread" pattern except
distributed across a network. I guess this is pretty easy to write
with a centralized socket listener that dispatches requests through a
Queue to multiple threads on the same machine, each talking
synchronously to a server socket. I wonder if something like it
already exists. I see a little bit of discussion in the newsgroup
archive but no obvious pointers to code.
Take a look at the work being done on IPython:

http://ipython.scipy.org/moin/Parallel_Computing

--
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless enigma
that is made terrible by our own mad attempt to interpret it as though it had
an underlying truth."
-- Umberto Eco

Mar 10 '07 #2

PaulDoes anyone have an implementation of a distributed queue? I.e. I
Paulhave a long running computation f(x) and I'd like to be able to
Paulevaluate it (for different values of x) on a bunch of different
Paulcomputers simultaneously, the usual "worker thread" pattern except
Pauldistributed across a network.

PyBrenda maybe? (Dunno if it's even still around.)

Skip
Mar 11 '07 #3
Paul Rubin wrote:
Does anyone have an implementation of a distributed queue? I.e. I
have a long running computation f(x) and I'd like to be able to
evaluate it (for different values of x) on a bunch of different
computers simultaneously, the usual "worker thread" pattern except
distributed across a network.
Doesn't sound difficult to implement.
I guess this is pretty easy to write with a centralized socket
listener that dispatches requests through a Queue to multiple
threads on the same machine, each talking synchronously to a
server socket.
(Why does everyone think that "concurrency" equals "usage of
multiple threads"?)
I wonder if something like it already exists. I see a little bit
of discussion in the newsgroup archive but no obvious pointers to
code.
Try Twisted for your networking needs. With it it's quite easy to
develop an own little protocol (e. g. on top of TCP). When you have
this ready, writing a server and client using it is a matter of
minutes.

http://twistedmatrix.com/projects/co...o/servers.html
http://twistedmatrix.com/projects/co...o/clients.html

For bigger needs, Twisted also has RPC features.

Regards,
Björn
--
BOFH excuse #281:

The co-locator cannot verify the frame-relay gateway to the ISDN
server.

Mar 11 '07 #4
Bjoern Schliessmann <us**************************@spamgourmet.comwrite s:
(Why does everyone think that "concurrency" equals "usage of
multiple threads"?)
Well, it doesn't necessarily, but that's easiest a lot of the time.
Try Twisted for your networking needs.
I should try to understand Twisted better one of these days, but it's
much more confusing than threads. Also, the function I want to
parallelize does blocking operations (database lookups), so in Twisted
I'd have to figure out some way to do them asynchronously.
Mar 11 '07 #5
"Paul Rubin" <http://ph****@NOSPAM.invalidwrote:
Bjoern Schliessmann <us**************************@spamgourmet.comwrite s:
(Why does everyone think that "concurrency" equals "usage of
multiple threads"?)

Well, it doesn't necessarily, but that's easiest a lot of the time.
Try Twisted for your networking needs.

I should try to understand Twisted better one of these days, but it's
much more confusing than threads. Also, the function I want to
parallelize does blocking operations (database lookups), so in Twisted
I'd have to figure out some way to do them asynchronously.
I would think of making 'pullers' in the remote machines in front of
whatever it is you are making parallel to get the next thing to do,
from a 'queue server' in the originating machine to distribute the
stuff.

I am not sure if Pyro can help you as I have only read about it and
not used it but I think its worth a look. If it were a one on one
setup I would not hesitate to recommend it but I can't remember
if it is any good for one to many scenarios.

- Hendrik
Mar 11 '07 #6
Paul Rubin wrote:
Does anyone have an implementation of a distributed queue? I.e. I
have a long running computation f(x) and I'd like to be able to
evaluate it (for different values of x) on a bunch of different
computers simultaneously, the usual "worker thread" pattern except
distributed across a network. I guess this is pretty easy to write
with a centralized socket listener that dispatches requests through a
Queue to multiple threads on the same machine, each talking
synchronously to a server socket. I wonder if something like it
already exists. I see a little bit of discussion in the newsgroup
archive but no obvious pointers to code.

Thanks.
Pyro (http://pyro.sf.net) contains 2 examples that do just this.
One is a distributed merge sort / md5 "cracker", the other is
distributed prime factorization of a set of numbers.

--Irmen
Mar 11 '07 #7
Paul Rubin wrote:
Bjoern Schliessmann <us**************************@spamgourmet.com>
>(Why does everyone think that "concurrency" equals "usage of
multiple threads"?)

Well, it doesn't necessarily, but that's easiest a lot of the
time.
I don't think so. Personally, I like multiplexing better. I think it
has less complex code.
>Try Twisted for your networking needs.

I should try to understand Twisted better one of these days, but
it's much more confusing than threads.
Sure? I don't think so. I once tried using threads and quickly had
more code for threading than for my functionality, and even had
problems, e. g. with synchronisation or shutting down properly.

IMHO, Twisted is easier, like most multiplexing techniques: Just
write your code (derived from existing client or server classes)
and hook it up to the reactor, and the rest works automagically.

(You can even hook your protocol to stdin/stdout or install
a "manhole" in the server. You also have twistd which does all the
daemon and logging work for you. Yes, I'm biased ;) )
Also, the function I want to parallelize does blocking operations
(database lookups), so in Twisted I'd have to figure out some way
to do them asynchronously.
Twisted _is_ asynchronous networking. It also has database classes:

http://twistedmatrix.com/documents/c...nterprise.html

Regards,
Björn

--
BOFH excuse #292:

We ran out of dial tone and we're and waiting for the phone company
to deliver another bottle.

Mar 11 '07 #8
On 2007-03-10, Paul Rubin <httpwrote:
Does anyone have an implementation of a distributed queue? I.e. I
have a long running computation f(x) and I'd like to be able to
evaluate it (for different values of x) on a bunch of different
batchlib and the underlying exec_proxy are designed to handle exactly this type
of problem.
Both of them are in PyPI (and available at my site http://se.wtb.tue.nl/~hat).

Alnert
Mar 12 '07 #9
Bjoern Schliessmann <us**************************@spamgourmet.comwrite s:
Twisted _is_ asynchronous networking. It also has database classes:
http://twistedmatrix.com/documents/c...nterprise.html
I see it uses threads:

http://twistedmatrix.com/trac/browse...adbapi.py#L326
Mar 13 '07 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
2261
by: Constandinos Mavromoustakis | last post by:
CFP: CLADE 2004-Challenges of Large Applications in Distributed Environments ------------------------------------------------- PhD student - Dept.Informatics at Aristotle University of...
7
2365
by: Richard Maher | last post by:
Hi, I am seeking the help of volunteers to test some software that I've developed which facilitates distributed two-phase commit transactions, encompassing any resource manager (e.g. SQL/Server...
2
2603
by: Rodrigo García | last post by:
Hi. The problem is a bit hard to explain. I have a ServicedComponent method which runs a distributed transaction consisting on a a MessageQueue reception and several database operations. That...
1
2991
by: Rhino | last post by:
Is there any way to install the IBM Distributed Debugger V9.2 on Windows XP without first uninstalling DB2? I installed the IBM Distributed Debugger V9.2 on my Windows XP box in the hopes of...
3
1077
by: Tim Marsden | last post by:
I am new to distributed application programming. Could anybody give me advice on how to accomplish the following? I am writing in VB.NET. I would like to keep away from web services and IIS if...
3
5137
by: Kceiw | last post by:
Dear all, When I use #include "queue.h", I can't link it. The error message follows: Linking... G:\Projects\Datastructure\Queue\Debug\main.o(.text+0x136): In function `main':...
3
2026
by: jrpfinch | last post by:
I have a script which is based on the following code. Unfortunately, it only works on Python 2.3 and not 2.5 because there is no esema or fsema attribute in the 2.5 Queue. I am hunting through...
4
4589
by: j_depp_99 | last post by:
Thanks to those guys who helped me out yesterday. I have one more problem; my print function for the queue program doesnt work and goes into an endless loop. Also I am unable to calculate the...
0
2727
by: ecestd | last post by:
I did implement the copy constructor but still have a problem with it. It is not working. What could be wrong? #include "QueueP.h" #include <cassert // for assert #include <new // for...
0
7252
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7153
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7432
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
7517
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
5077
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4743
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
1583
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
791
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
452
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.