473,659 Members | 2,690 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Best method for inter process communications

I am looking for a way of performing inter process communication over
XML between a python program and something else creating XML data.

What is the best way of performing this communication? I could bind a
socket to localhost and perform the data transfer that way, but that
seems inefficient due to the addition of TCP/IP or UDP/IP overhead.
Is there a way to stream data via a custom datastream (I.E. not STDIO,
STDERR, etc)?

Thanks in advance,
Jim Howard

Jul 16 '07 #1
8 2587
On Mon, 2007-07-16 at 17:22 +0000, JamesHoward wrote:
I am looking for a way of performing inter process communication over
XML between a python program and something else creating XML data.

What is the best way of performing this communication? I could bind a
socket to localhost and perform the data transfer that way, but that
seems inefficient due to the addition of TCP/IP or UDP/IP overhead.
Is there a way to stream data via a custom datastream (I.E. not STDIO,
STDERR, etc)?
In *nix, you could also use a named pipe for cheap RPC (os.mkfifo()).

-a

Jul 16 '07 #2
JamesHoward wrote:
I am looking for a way of performing inter process communication over
XML between a python program and something else creating XML data.

What is the best way of performing this communication? I could bind a
socket to localhost and perform the data transfer that way, but that
seems inefficient due to the addition of TCP/IP or UDP/IP overhead.
Is there a way to stream data via a custom datastream (I.E. not STDIO,
STDERR, etc)?
Nothing that portable across different platforms, I suspect.

However I see no reason why you can't use pipelines in Unix (in other
words what's wrong with using stdin/stdout?), and Windows offers
something called a named pipe. You could even use shared memory if you
wanted.

Given the radically inefficient representations that XML typically
requires, however, I think that worrying about localhost socket overhead
is unnecessary: if your application was *that* critical you wouldn't be
using XML in the first place.

regards
Steve
--
Steve Holden +1 571 484 6266 +1 800 494 3119
Holden Web LLC/Ltd http://www.holdenweb.com
Skype: holdenweb http://del.icio.us/steve.holden
--------------- Asciimercial ------------------
Get on the web: Blog, lens and tag the Internet
Many services currently offer free registration
----------- Thank You for Reading -------------

Jul 16 '07 #3
On 2007-07-16, JamesHoward <Ja************ @gmail.comwrote :
I am looking for a way of performing inter process communication over
XML between a python program and something else creating XML data.

What is the best way of performing this communication? I could bind a
socket to localhost and perform the data transfer that way, but that
seems inefficient due to the addition of TCP/IP or UDP/IP overhead.
Is there a way to stream data via a custom datastream (I.E. not STDIO,
STDERR, etc)?
You could use a named pipe or a Unix domain socket. The nice
thing about an IP socket is that you get network transparancy:
the two programs can be moved to two different machines.

--
Grant Edwards grante Yow! It's the RINSE CYCLE!!
at They've ALL IGNORED the
visi.com RINSE CYCLE!!
Jul 16 '07 #4
Thanks for the updates. I think I will try named processes first, but
may just end up using local sockets in the end and not worry about the
overhead.

Jim Howard

Jul 16 '07 #5
"Steve Holden" <st***@holdenwe b.comwrote:
Given the radically inefficient representations that XML typically
requires, however, I think that worrying about localhost socket overhead
is unnecessary: if your application was *that* critical you wouldn't be
using XML in the first place.
I heard a rumour once that a "hello world" string takes something like
10k bytes in XMLRPC - have never bothered to find out if its BS...

- Hendrik

Jul 17 '07 #6
On Tue, 17 Jul 2007 08:08:45 +0200, Hendrik van Rooyen wrote:
I heard a rumour once that a "hello world" string takes something like
10k bytes in XMLRPC - have never bothered to find out if its BS...
Just try it out:

In [8]: import xmlrpclib

In [9]: a = xmlrpclib.dumps (('hello world',))

In [10]: len(a)
Out[10]: 80

In [11]: print a
<params>
<param>
<value><string> hello world</string></value>
</param>
</params>

Even with some additional boilerplate like XML declaration etc. there is
still a little bit room until 10Â*kB are reached. :-)

Ciao,
Marc 'BlackJack' Rintsch
Jul 17 '07 #7
JamesHoward wrote:
I am looking for a way of performing inter process communication over
XML between a python program and something else creating XML data.
What is that "something else"?
--irmen
Jul 17 '07 #8
"Marc 'BlackJack' Rintsch" <bj_666@....net wrote:
On Tue, 17 Jul 2007 08:08:45 +0200, Hendrik van Rooyen wrote:
I heard a rumour once that a "hello world" string takes something like
10k bytes in XMLRPC - have never bothered to find out if its BS...
Just try it out:

In [8]: import xmlrpclib

In [9]: a = xmlrpclib.dumps (('hello world',))

In [10]: len(a)
Out[10]: 80

In [11]: print a
<params>
<param>
<value><string> hello world</string></value>
</param>
</params>

Even with some additional boilerplate like XML declaration etc. there is
still a little bit room until 10 kB are reached. :-)

LOL - so one could say it was a bit of an exaggeration...

Thanks - Hendrik

Jul 18 '07 #9

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

Similar topics

31
2911
by: Chris S. | last post by:
Is there a purpose for using trailing and leading double underscores for built-in method names? My impression was that underscores are supposed to imply some sort of pseudo-privatization, but would using myclass.len() instead of myclass.__len__() really cause Python considerable harm? As much as I adore Python, I have to admit, I find this to be one of the language's most "unPythonic" features and a key arguing point against Python. I've...
11
9243
by: DrUg13 | last post by:
In java, this seems so easy. You need a new object Object test = new Object() gives me exactly what I want. could someone please help me understand the different ways to do the same thing in C++. I find my self sometimes, trying Object app = Object(); Object *app = Object(); Object app = new Object();
1
3096
by: James E | last post by:
I have a question about best practices of how to deal with lookup data from my C# apps. On a couple of occasions I have come across a problem where I have to automate inserting a record into a table that has a foreign key constraint that is linked to a lookup table. E.g. Take the following database structure: SQL-Server Database: Table 1:
7
31695
by: A.M | last post by:
Hi, What is the best way to implemet Inter Process Communication in .NET ? I developed two programs and I want to have them talk to each other. Thanks, Alan
1
1781
by: LordHog | last post by:
Hello all, I am a small application that I am developing which will use a few threads. When the user closes the form the threads will remain present until I close them. The Main Form instantiates a couple of communications classes which contain the threads. So for this communications class should I provide some sort of close/kill/terminate method or should I provide a dispose() function to terminate the threads? Thanks for any insight.
4
1194
by: Paul Baker | last post by:
Hello All, This is my first post so apologies if this is the wrong newsgroup. I'm designing software for a platform that will sit on a CAN bus. There will be three separate programs running on the platform, A, B and C. Program A will handle the CAN communications. It will pass messages received from the CAN network to programs B and C and transmit their messages out on the CAN network.
2
2371
by: Steve Le Monnier | last post by:
Can anybody give me a quick heads up on the best way to develop C# based DLL's that are called via VBA. I'm developing a pop-up window that will record information within SQL. I need to launch this pop-up from an application that only supports VBA. So I decided the best solution would be to create a DLL with C# that exposes the methods needed to launch my pop-up window. My first attempt didn't work and after spending several hours on...
0
1873
by: Hugo Ferreira | last post by:
Hi everyone! Here's the current scenario: I have a program in Python that computes something very fast (<1s), but it takes a considerable amount of time to read the startup data (>90s). Since the startup data is pretty static, I want this program to be resident and ready in memory all the time. The client-side of this program is a function in PostgreSQL. For the sake of simplicity, let's assume it is another program in Python that
2
2950
by: hiharsh | last post by:
Hi Friends, I am trying to implement C programs say Transmit.c and Receive.c Transmit Program would periodicall send message while Receive program will listen to those messge. I will add more complexities , once i achieve this step How do i achieve this ?
0
8427
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
8851
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
8746
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...
0
8627
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
4175
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...
0
4335
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2750
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
1975
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1737
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.