473,503 Members | 1,733 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 2575
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***@holdenweb.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@....netwrote:
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
2885
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...
11
9211
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...
1
3076
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...
7
31689
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
1769
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...
4
1189
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...
2
2361
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...
0
1862
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...
2
2936
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...
0
7203
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
7281
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,...
0
7334
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...
1
5014
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
3168
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...
0
3156
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1514
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
737
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
383
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.