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 3 1461
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
RegisterWindowM essage 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.
"Sharon" <Sh*****@newsgr oups.nospam> wrote in message
news:E1******** *************** ***********@mic rosoft.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.
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. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
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 programs I will be
writing), the old one is booted off (and its process ended).
My master process is a test harness, which tests a script which as part
of its functionality sends http GET messages. My test harness sets up
an http server as a...
|
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 task by
running as a service on Windows 2000, but it fails on Win NT due to a
missing procedure entry point "RegisterServiceCtrlHandlerExW" in
ADVAPI32.dll; this problem appears to be due to the servicemanager
module, and exists in all versions...
|
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 916 0.0 0.3 38616 3936 ? S 17:39 0:02
/usr/sbin/mysqld --defaults-file=/etc/my.cnf --basedir=/
--datadir=/var/lib/mys
(root 881 0.0 0.0 4284 4 ? S 17:39 0:00 /bin/sh
|
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 named event, the first to fail
will do a Create on the named event from that point on
Process B will signal Process A by setting the named
event and Process B has a thread blocked on waiting for
the event which when fired will be immediately reset as...
|
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 to a pool. If I assign only one
application to a applicaton pool and have multiple worker processes
assigned to that pool. Will my application be processed by many worker
processes?
| |
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? I've been leaning
towards threads, I'm going to say why.
Processes seem fairly expensive from my research so far. Each fork
copies the entire contents of memory into the new process. There's also
a more expensive context switch between...
|
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 os.chdir was process-
global.
(2) Next thought was fork, but I don't know how to signal when each
child is
finished.
(3) Current thought is to break the process from a method into a
|
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
| finished.
|
| (1) First thought was threads, until I saw that os.chdir was process-
| global.
Yep. But do you need separate working directories?
As opposed to having the thread state include a notional working
|
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 os.chdir was process-global.
(2) Next thought was fork, but I don't know how to signal when each child is
finished.
(3) Current thought is to break the process from a method into a external
script; call the script in separate threads. This is the...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
|
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...
| |
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...
|
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...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
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
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
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...
| |