473,834 Members | 1,799 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Advanced concurrancy

Hi,

I'm looking for an advanced concurrency module for python and don't seem
to be able to find anything suitable. Does anyone know where I might
find one? I know that there is CSP like functionality built into
Stackless but i'd like students to be able to use a standard python build.

I'm trying to develop distributed / Grid computing modules based on
python. The aim is to be able to use barriers for synchronisation and
channels for communication between processes running on a single box.
Then the jump to multiple processes on multiple boxes and eventually to
MPI implementations . Hopefully, each jump should not be that big a leap.

Of course it would be nice if there was a robust way of managing
concurrency in python aswell ;-)

p
Jul 28 '05
15 1910
on 04.08.2005 00:36 Michael Sparks said the following:
Peter Tillotson wrote:
I'm quite interested in the mini version and also using the modules as
mobile code rather than installing it formally.


I'll document it slightly better and post up on the website in the next 48
hours or so. In the meantime, the optimisation test which includes a
slightly modified mini-axon can be found here:

http://cvs.sourceforge.net/viewcvs.p...imisationTest/

Specifically the file "simplegame.py" .


Hi, sorry to intrude here.
I looked at Kamaelia (Axon actually) recently and I liked it,
what I did miss in the code (maybe I just did not find it) is a blocking
way for send-ing and recv-ing from in/outboxes that the scheduler is
aware of.
It seems as though all components basically have to do busy waiting now.

So do you plan on including a kind of scheduler-aware blocking
communication (like the `channels` of the `tasklets` in stackless)?

(as you have a postman already - not a bad idea i think if you compare
with multi-agent-systems theory (see jade) - it could be responsible for
alerting the scheduler of box.has_data)

Cheers,
Stefan

Aug 4 '05 #11
Hi Stefan,
It seems as though all components basically have to do busy waiting now.
You are right - components are, for the most part, busy-waiting. Which
is not a good thing!
So do you plan on including a kind of scheduler-aware blocking
communication (like the `channels` of the `tasklets` in stackless)?

(as you have a postman already - not a bad idea i think if you compare
with multi-agent-systems theory (see jade) - it could be responsible for
alerting the scheduler of box.has_data)


There is basic support for components to block, by calling the
self.pause() method. From the next yield, this blocks further execution
until
data arrives on any inbox.

The un-pausing action is actually performed by code within the
component
itself, though this is in effect, as you suggested it might be,
instigated by
the postman microprocess.

A simple example would be an improved 'consoleEcho' component:

class consoleEchoer(A xon.Component.c omponent):
....
def main(self):
while 1:
yield 1
while self.dataReady( "inbox"):
print self.recv("inbo x")
self.pause()

That said, if you look at the code, you'll see that probably the
majority of components do not make good use of this yet!

There are quite probably better mechanisms around - hence the
distinction, in the code, between microprocesses and components.
We'd be very interested if yourself or other people want to play with
alternative communication & blocking mechanisms.

I'd hope that even if the components and postboxes model doesn't
work out in the long run, the underlying generator based
microprocesses code could still be of some value to others!
regards
Matt

Aug 4 '05 #12
Ooops! In case you're wondering who I am, I'm working
on Kamaelia with Michael Sparks at the BBC.
Matt

Aug 4 '05 #13
on 04.08.2005 11:15 Matt Hammond said the following:
Hi Stefan,
It seems as though all components basically have to do busy waiting now.
You are right - components are, for the most part, busy-waiting. Which
is not a good thing!
So do you plan on including a kind of scheduler-aware blocking
communicati on (like the `channels` of the `tasklets` in stackless)?

[snip]
There is basic support for components to block, by calling the
self.pause() method. From the next yield, this blocks further execution
until
data arrives on any inbox.
[snip]

ah, i was searching for blocking on a specific inbox, but this is
actually a saner approach i think. why should you block on one inbox and
ignore data coming in on another...
There are quite probably better mechanisms around - hence the
distinction, in the code, between microprocesses and components.
We'd be very interested if yourself or other people want to play with
alternative communication & blocking mechanisms.
i think in-out channels is probably the best way for easy to manage
comunicating processes.
I'd hope that even if the components and postboxes model doesn't
work out in the long run, the underlying generator based
microprocesses code could still be of some value to others!


yes both levels will (it will take some time before i can use it
here...), i think of it as a more complete version of some of the
stackless features in standard python. (thanks again by the way)
the magic.greenlets have 'cooperative microprocesses' , but lack the more
pipe-like communication facilities and the independency of the
generators+sche duler based approach.
the coroutine support in future pythons (see the generator PEPs) will
probably make this easier... maybe::

next_inbox_to_r ead = yield blockon(inbox1, inbox2)

this communication infrastructure is definitely a Good Thing (TM), the
same holds for a standard environment or registry (wassitsname, your CAT
thing) as you need at least one well-known point of reference in a
'distributed' system.

<dreamingmode >
now if someone could only cut the gordian knot of the
GlobalInterpret erLock to make all this really concurrent... and then,
when she's at it, allow transparent distribution of components in a
network... ;-)
</dreamingmode>

Aug 5 '05 #14
Hi Stefan,

On Fri, 05 Aug 2005 07:20:36 +0100, Stefan Rank <st*********@of ai.at>
wrote:
So do you plan on including a kind of scheduler-aware blocking
communication (like the `channels` of the `tasklets` in stackless)?

Not at the moment. The kinds of applications we've mainly been looking at,
whilst developing, have been multimedia data-flow oriented, so blocking
communication would be used as a rate limiting mechanism. However, we've
found we can achieve that by putting explicit feedback links in.

I think we are also trying to stick with the asynchronous way, if
possible, because it may well make things simpler and more efficient when
it comes to distributing components across processes / networked
computers. Synchronous links will lead to handshaking latencies, more data
needing to flow etc. IMO that kind of facility could always be built on
top - for example - using a feedback inbox->outbox path to 'request' new
data ... if you really need it.

.... it also simplifies the scheduler. We've tried, so far, to keep the
underlying microprocess model decoupled from the components and
inbox/outbox layer. That said, that may have to change eventually!
this communication infrastructure is definitely a Good Thing (TM), the
same holds for a standard environment or registry (wassitsname, your CAT
thing) as you need at least one well-known point of reference in a
'distributed' system.
yep its a CAT (Coordinating Assistant Tracker). Nothing to do with the
project logo ... nooo! :-)
<dreamingmode >
now if someone could only cut the gordian knot of the
GlobalInterpret erLock to make all this really concurrent... and then,
when she's at it, allow transparent distribution of components in a
network... ;-)
</dreamingmode>


I'll second that!

regards
Matt
--

| Matt Hammond
| R&D Engineer, BBC Research and Development, Tadworth, Surrey, UK.
Aug 9 '05 #15
Hi, I've been on the research pursuit regarding these subjects and I
wonder why Erlang doesn't fit well into this category of concurrency.

Also, from what I have seen, there hasn't been a recent interest in an
updated interface. Maybe I'm mistaken and Erlang's features don't apply
well. Thanks for your comments.

Peter

Aug 28 '05 #16

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

Similar topics

8
2800
by: Millissa | last post by:
If someone can help me with examples of or info on how to create an advanced tables for the layout on my site, I would be very grateful! Thanks, M
10
2741
by: John Wells | last post by:
Are there any books out there that are fairly current, but go into the more advanced aspects of Postgresql, such as internals and advanced programming? I'd rather avoid the whole intro to SQL with a few extra chapters on Postgresql if I could help it. Thanks, John
2
2492
by: Mike Sweetman | last post by:
I have a form Form1 which when the Advanced Filter/Sort is used creates a form(maybe) with a title 'Form1Filter1 : Filter'. When I apply the filter to Form1 it is applied, but the value of Form1.Filter is ''. How do I obtain the Advanced Filter/Sort criteria as a string ? I cannot reference the object 'Form1Filter1 : Filter' by using Form1Filter1.
4
5142
by: Nhmiller | last post by:
This is directly from Access' Help: "About designing a query When you open a query in Design view, or open a form, report, or datasheet and show the Advanced Filter/Sort window (Advanced Filter/Sort window: A window in which you can create a filter from scratch. You enter criteria expressions in the filter design grid to restrict the records in the open form or datasheet to a subset of records that meet the criteria.), you see the design...
9
2973
by: John Robert | last post by:
Hi! Anyone has recommendations for advanced ASP.NET books? By advanced, I mean complicated stuff... not just authentification and datagrid binding I'm mainly interrested in learning more about letting my customers customize a web forms (from a database... on the fly control creation and persisting data), and other advanced topics.
11
1688
by: vdrab | last post by:
Hi all, Is there some sort of coherent source (dead tree format, maybe?) on some of the more advanced features of python (decorators, metaclasses, etc)? I'm sort of looking for a python book that actually gets to the good stuff at some point, without first spending 6 chapters on how to append ints to a list. I can't seem to find any. I get the impression people just get by with scraps and code snippets
4
1970
by: mike_li | last post by:
Passed DB2 UDB 701 test, how can I prepare for 704 test (Advanced DBA)? There is not as many info. on this test as on others. Thanks. Mike
10
2345
by: jklimek | last post by:
I'm currently a Delphi developer (my day job) but at my company we only write custom web application/database stuff, so we never really get into anything advanced. However, I know enough about pointers, objects, etc, to consider myself an "intermediate" level programmer. Well, I'm looking to write a game involving physics and multiplayer capability, and that pretty much means I need C++ if I want to use any existing engines (eg. HGE,...
0
1864
by: Andrew Meador - ASCPA, MCSE, MCP+I, Network+, A+ | last post by:
I am running Access 2007. I have a report that I want to filter. I can go into Advanced...Advanced Filter/Sort... and setup a filter that works fine on the report when I apply it. When in this query creation area, I can right click and Save Query. I have saved a query fine. However, now if I go back later (after closing Access or the report) when I open it it back up (the report), I go back to Advanced...Advanced Filter/Sort.. right click...
0
9799
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
10515
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
10554
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10224
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9338
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6960
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
5629
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
4428
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
2
3985
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.