473,320 Members | 2,122 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Inter process signalling

In Linux this is easy with 'signal' and 'kill' but how can I get one Python
process to signal another (possibly running as a service)?

All I need is a simple prod with no other data being sent and none being
returned - except that the signal was delivered.

Receiving a signal should generate an interrupt. I'm not looking for a
solution the involves polling.

Thanks
--
Dale Strickland-Clark
Riverhall Systems www.riverhall.co.uk

Sep 12 '06 #1
4 2161
Dale Strickland-Clark wrote:
In Linux this is easy with 'signal' and 'kill' but how can I get one
Python process to signal another (possibly running as a service)?

All I need is a simple prod with no other data being sent and none being
returned - except that the signal was delivered.

Receiving a signal should generate an interrupt. I'm not looking for a
solution the involves polling.

Thanks
The essential bit of information missing from this is: on Windows.

I want to signal between processes running *on Windows*.

That's what happens when you try to rush a post before going home.
Thank you for your tolerance.
--
Dale Strickland-Clark
Riverhall Systems www.riverhall.co.uk

Sep 12 '06 #2
Dennis Lee Bieber wrote:
Unfortunately... You are on Windows...

I think your choices become: Block, or Poll

Check the Win32Api modules...

win32event may be a candidate...
CreateEvent()
OpenEvent()
PulseEvent()
SetEvent()
ResetEvent()
WaitForSingleObject() or WaitForMultipleObjects()
Thanks. We'll look into those.
--
Dale Strickland-Clark
Riverhall Systems - www.riverhall.co.uk

Sep 13 '06 #3
Dale Strickland-Clark <da**@riverhall.nospam.co.ukwrote:
In Linux this is easy with 'signal' and 'kill' but how can I get one
Python process to signal another (possibly running as a service)?

All I need is a simple prod with no other data being sent and none
being returned - except that the signal was delivered.

Receiving a signal should generate an interrupt. I'm not looking for a
solution the involves polling.
Lots of ways. Basically all involving creating a thread which waits on an
event and then calls your code when the event is generated.

You can use semaphores, named pipes &c.; you could create a windows message
queue and simply send the process a message when you want to alert it; you
could create a COM server and call a method on it; you could use
asynchronous procedure calls (APCs) (but you still need to ensure that
there is a thread in an alertable wait state).

If the code you want to signal is running as a service then the easiest way
to signal it is to call win32service.ControlService with a user defined
service code. That gives you 127 signals to play with, and Python's win32
library will simply call the SvcOther method within your service code
(although not of course using the same thread as the actual service is
running on).
Sep 13 '06 #4
Duncan Booth wrote:
Dale Strickland-Clark <da**@riverhall.nospam.co.ukwrote:
>In Linux this is easy with 'signal' and 'kill' but how can I get one
Python process to signal another (possibly running as a service)?

All I need is a simple prod with no other data being sent and none
being returned - except that the signal was delivered.

Receiving a signal should generate an interrupt. I'm not looking for a
solution the involves polling.
Lots of ways. Basically all involving creating a thread which waits on an
event and then calls your code when the event is generated.

You can use semaphores, named pipes &c.; you could create a windows
message queue and simply send the process a message when you want to alert
it; you could create a COM server and call a method on it; you could use
asynchronous procedure calls (APCs) (but you still need to ensure that
there is a thread in an alertable wait state).

If the code you want to signal is running as a service then the easiest
way to signal it is to call win32service.ControlService with a user
defined service code. That gives you 127 signals to play with, and
Python's win32 library will simply call the SvcOther method within your
service code (although not of course using the same thread as the actual
service is running on).
Thanks Duncan.
--
Dale Strickland-Clark
Riverhall Systems - www.riverhall.co.uk

Sep 13 '06 #5

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

Similar topics

18
by: jas | last post by:
Hi, I would like to start a new process and be able to read/write from/to it. I have tried things like... import subprocess as sp p = sp.Popen("cmd.exe", stdout=sp.PIPE)...
4
by: Frank Meng | last post by:
Hi. I am trying a csharp sample from http://www.codeproject.com/csharp/socketsincs.asp . (Sorry I didn't post all the source codes here, please get the codes from above link if you want to try)....
4
by: Viper Venom | last post by:
Dear All: I am trying to write an application that consist 2 executables 1) Server.exe 2) Client.exe I start the server.exe first and then start the two client exe by code and kill both of...
7
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
13
by: Bern McCarty | last post by:
I have run an experiment to try to learn some things about floating point performance in managed C++. I am using Visual Studio 2003. I was hoping to get a feel for whether or not it would make...
10
by: Susan | last post by:
I have a process that takes a while to run so I have it running asynchronously so that the user can continue working. My question is that I want to killl the process if the user changes the search...
0
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...
28
by: Jon Davis | last post by:
We're looking at running a memory-intensive process for a web site as a Windows service in isolation of IIS because IIS refuses to consume all of the available physical RAM. Considering remoting to...
0
by: dantz | last post by:
After reading all of the materials in msdn about interprocess communication now I am confused. I hope someone can give me some enlightment. I am developing a multithreaded client-server...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....

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.