Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Inter process signalling

Reply
Thread Tools

Inter process signalling

 
 
Dale Strickland-Clark
Guest
Posts: n/a
 
      09-12-2006
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

 
Reply With Quote
 
 
 
 
Dale Strickland-Clark
Guest
Posts: n/a
 
      09-12-2006
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

 
Reply With Quote
 
 
 
 
Dennis Lee Bieber
Guest
Posts: n/a
 
      09-13-2006
On Tue, 12 Sep 2006 18:01:27 +0100, Dale Strickland-Clark
<(E-Mail Removed)> declaimed the following in
comp.lang.python:

> The essential bit of information missing from this is: on Windows.
>
> I want to signal between processes running *on Windows*.
>

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()
--
Wulfraed Dennis Lee Bieber KD6MOG
http://www.velocityreviews.com/forums/(E-Mail Removed) (E-Mail Removed)
HTTP://wlfraed.home.netcom.com/
(Bestiaria Support Staff: (E-Mail Removed))
HTTP://www.bestiaria.com/
 
Reply With Quote
 
Dale Strickland-Clark
Guest
Posts: n/a
 
      09-13-2006
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

 
Reply With Quote
 
Duncan Booth
Guest
Posts: n/a
 
      09-13-2006
Dale Strickland-Clark <(E-Mail Removed)> 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.
>

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).
 
Reply With Quote
 
Dale Strickland-Clark
Guest
Posts: n/a
 
      09-13-2006
Duncan Booth wrote:

> Dale Strickland-Clark <(E-Mail Removed)> 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.
>>

> 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

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Portably killing/signalling another process not supported? John Nagle Python 2 01-26-2008 08:26 PM
Line Signalling R2 and DTMF for outgoing signaling Question, ws00sw@gmail.com Cisco 0 05-12-2005 05:51 PM
SIP vs H.323 as signalling for Cisco voice gateway jmiklo Cisco 2 02-22-2005 05:29 AM
Signalling end-of-stream to a Java program in Command Prompt Window gwcherryHatesGreenEggsAndSpam@alum.mit.edu Java 1 02-21-2005 02:30 AM
in-band DTMF signalling on Cisco Call Manager 3.3 Jim Brunetti VOIP 2 07-15-2004 11:14 AM



Advertisments