473,385 Members | 1,732 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,385 software developers and data experts.

Processes signaling is missing ?

I need to use some kind of signaling among processes, but the only thing I
found that can something like that is the Mutex.

But the Mutex doesn’t have a real signaling, it only has Wait() and
Release(), the trouble is that the Wait returns not only if the Mutex is
released, but also if I’m the only one who created it or the only one that
has it, and that is not good for me.

I need to know if the other process signaled or not, regardless if he’s
running and if created it.

In C/C++ I could use the events, but in .NET is seems that the
AutoResetEvent and MnualResetEvent are for use among threads and not process.
Can anybody have an Idea how can I do that?
-------
Thanks
Sharon
Nov 17 '05 #1
3 1445
Hi Sharon,

Thanks for your post.

Yes, currently in .Net, there is few build-in support for doing
inter-process communication, we still have to resort to old Win32 ways to
get this done.

In Win32 world, there are a lots of ways to do inter-process communication.
For example, if your applications have UI, we can p/invoke
RegisterWindowMessage to register a system-wide customized message, then 2
applications send/post this message to communicate with each other.(Note:
we can listen this message with overriding Form.WndProc method)
Below is the C++ code to do this, but it should not be hard to convert it
to C# p/invoke code:
http://www.codeguru.com/vb/gen/vb_sy...cle.php/c7401/

Also, we may use WM_COPYDATA message to do the communication. Below is
another C++ article(sorry I can not find any good article on C#):
http://www.codeproject.com/threads/ipc_wmcopy.asp

Further more, if your applications do not have UI, we can not rely on
windows messages. Then we can use other inter-process communication
technologies, such as Named Pipe, Memory Mapped file etc.., please refer to
the articles below:
"Inter-Process Communication in .NET Using Named Pipes, Part 1"
http://www.codeproject.com/csharp/Do...PipesPart1.asp
"A C# Framework for Interprocess Synchronization and Communication"
http://www.codeproject.com/csharp/csthreadmsg.asp

Finally, the .Net way of doing inter-process communication is .Net
Remoting, you can find a lot of articles on .Net Remoting in MSDN or
google.

Hope this helps.

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

Nov 17 '05 #2

"Sharon" <Sh*****@newsgroups.nospam> wrote in message
news:E1**********************************@microsof t.com...
I need to use some kind of signaling among processes, but the only thing I
found that can something like that is the Mutex.

But the Mutex doesn’t have a real signaling, it only has Wait() and
Release(), the trouble is that the Wait returns not only if the Mutex is
released, but also if I’m the only one who created it or the only one
that
has it, and that is not good for me.

I need to know if the other process signaled or not, regardless if he’s
running and if created it.

In C/C++ I could use the events, but in .NET is seems that the
AutoResetEvent and MnualResetEvent are for use among threads and not
process.
Can anybody have an Idea how can I do that?

Yep, PInvoke the CreateEvent, OpenEvent, ResetEvent, SetEvent, CloseHandle
Win32 API's, or wait for v2.0 of the framework and use the EventWaitHandle
class.

Willy.
Nov 17 '05 #3
Hi Sharon,

Does our replies make sense to you? If you still have any concern, please
feel free to tell me, thanks

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

Nov 17 '05 #4

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

Similar topics

4
by: Pif Paf | last post by:
I am writing programs that will run as TCP servers. Briefly, I want to set up a TCP server on a port in such a way that if another server is already sitting on that port (both servers are Python...
0
by: David L. Jessup | last post by:
Hi there: I am trying to write a program to monitor certain processes on a Windows NT 4.0 box without me needing to be logged in. I have successfully created a python program that performs this...
0
by: Fagyal, Csongor | last post by:
Hi, I have a P4 server with RedHat 8.0 running on the lates stable kernel. I also have MySQL 3.23.54 installed. My problem is that when I do a 'ps aux', I only see one mysql process: mysql ...
0
by: Ray G. | last post by:
I am converting some legacy code which will consist of 2 WinForm applications. In the legacy code Process A signaled Process B using a named event (e.g. each process attempts to Open the same...
9
by: Abhishek Srivastava | last post by:
Hello All, In IIS 6.0 We have a concept of worker processes and application pools. As I understand it, we can have multiple worker process per appliction pool. Each worker process is dedicated...
35
by: Carl J. Van Arsdall | last post by:
Alright, based a on discussion on this mailing list, I've started to wonder, why use threads vs processes. So, If I have a system that has a large area of shared memory, which would be better? ...
6
by: Tim Arnold | last post by:
I have a bunch of processes to run and each one needs its own working directory. I'd also like to know when all of the processes are finished. (1) First thought was threads, until I saw that...
0
by: Cameron Simpson | last post by:
On 24Sep2008 18:27, Tim Arnold <a_jtim@bellsouth.netwrote: | I have a bunch of processes to run and each one needs its own working | directory. I'd also like to know when all of the processes are...
3
by: Tim Arnold | last post by:
I have a bunch of processes to run and each one needs its own working directory. I'd also like to know when all of the processes are finished. (1) First thought was threads, until I saw that...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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
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...

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.