473,624 Members | 2,261 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 1747
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 "concurrenc y" 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.com writes:
(Why does everyone think that "concurrenc y" 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.i nvalidwrote:
Bjoern Schliessmann <us************ **************@ spamgourmet.com writes:
(Why does everyone think that "concurrenc y" 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 "concurrenc y" 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.com writes:
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
2270
by: Constandinos Mavromoustakis | last post by:
CFP: CLADE 2004-Challenges of Large Applications in Distributed Environments ------------------------------------------------- PhD student - Dept.Informatics at Aristotle University of Thessaloniki URL-> http://agent.csd.auth.gr/~cmavrom -------------------------------------------------- -------------------------CLADE 2004--------------------------- Challenges of Large Applications in Distributed Environments June 7th, 2004, Honolulu,...
7
2375
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 or Oracle) controlled by Microsoft's Distributed Transaction Coordinator in a Windows2000 environment, with any resource manager under the control of DECdtm (e.g. Rdb (or Oracle via the XA Veneer)) in a VMS environment.
2
2609
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 ServicedComponent method is called from a pool of threads which get blocked in the Receive method of the queue. At that moment there are as many open transactions in the DTC as the number of threads in the pool. After 60 seconds of inactivity the...
1
3002
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 debugging a Java stored procedure. Well, I never got the debugger to work despite my best efforts - see posts earlier this week - so now I'd like to uninstall the debugger. I looked into this but the README says: 3.1 Uninstalling on Windows
3
1082
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 possible. Perhaps using some form of remoting. I would like to develop an application which sits on a "server". (or a Pc which sits in the corner)
3
5147
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': G:\Projects\Datastructure\Queue\main.cpp:16: undefined reference to `Queue<char>::Queue()' G:\Projects\Datastructure\Queue\Debug\main.o(.text+0x394): In function `Z10do_commandcR5QueueIcE':
3
2031
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 the Queue.py code now to try to figure out how to make it work in 2.5, but as I am a beginner, I am having difficulty and would appreciate your help. Many thanks Jon
4
4594
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 length of my queue. I started getting compilation errors when I included a length function. <code> template<class ItemType> void Queue<ItemType>::MakeEmpty() {
0
2735
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 bad_alloc #include <iostream> //typedef std::queue<QueueItemTypeQueue; using namespace std; //private:{Queue::Queue(const Queue& Q)}
0
8233
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8170
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8675
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8619
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
6108
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5561
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4078
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2604
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 we have to send another system
1
1784
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.