473,769 Members | 7,315 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to implement a remote Monitor ?

I would like to implement an MarshalByRef object similar to
System.Threadin g.Monitor. The interface would look like

class RemoteMonitor : MarshalByRef
{
public void Enter(object obj, Guid threadID) { ... }
public void Exit(object obj, Guid threadID) { ... }
}

Let assume that each remote Threads has its unique identifier, I would like
to be able to implement RemoteMonitor in order to have a semantic identical
to the System.Threadin g.Monitor. It's tricky and the only solutions I can
think of are complicated and computionally inefficient.

Does anyone has an idea?
Joannès
Nov 16 '05 #1
4 2002
Joannes,

I would ask first why you want to do this? To allow this kind of
granular control into a system from the outside doesn't seem like very good
design.

Can you elaborate?
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard. caspershouse.co m

"Joannes Vermorel" <fi*******@last name.com> wrote in message
news:uY******** ******@TK2MSFTN GP12.phx.gbl...
I would like to implement an MarshalByRef object similar to
System.Threadi ng.Monitor. The interface would look like

class RemoteMonitor : MarshalByRef
{
public void Enter(object obj, Guid threadID) { ... }
public void Exit(object obj, Guid threadID) { ... }
}

Let assume that each remote Threads has its unique identifier, I would
like to be able to implement RemoteMonitor in order to have a semantic
identical to the System.Threadin g.Monitor. It's tricky and the only
solutions I can think of are complicated and computionally inefficient.

Does anyone has an idea?
Joannès

Nov 16 '05 #2
> I would ask first why you want to do this? To allow this kind of
granular control into a system from the outside doesn't seem like very
good design.

Can you elaborate?


The reason lies in a transparent grid computing framework that I am working.
Look at the NGrid project on http://ngrid.sf.net (not really up to date, I
will release soon). Basically I want to implement a distributed Monitor.

Joannès
Nov 16 '05 #3
One question I have is does it need to be reentrant? Does an owner of the
lock need to be able to reenter the lock multiple times? If you just need
mutal exclusion, I might do a binary Semaphore with count of 1. See my
implementation at code project:
http://www.codeproject.com/csharp/Di...gSemaphore.asp

That way, you don't care what thread owns it, just that someone does. The
owner must release it when done. Other threads will block until lock free.
You need to handle situation where an owner dies and never frees the lock.
You have that issue regardess of the primitive used. You can use some
monitor thread or some timeout on lock that handles release after some X
seconds. You could also use a Mutex. That is reentrant and needs to be
released same number of times.

--
William Stacey

"Joannes Vermorel" <fi*******@last name.com> wrote in message
news:uD******** *******@TK2MSFT NGP10.phx.gbl.. .
I would ask first why you want to do this? To allow this kind of
granular control into a system from the outside doesn't seem like very
good design.

Can you elaborate?


The reason lies in a transparent grid computing framework that I am
working. Look at the NGrid project on http://ngrid.sf.net (not really up
to date, I will release soon). Basically I want to implement a distributed
Monitor.

Joannès

Nov 16 '05 #4
I finally manage to get a working solution based on Wait/Pulse and Hashtable
containing the entering counts (the lock re-entry feature was required). The
code could be found(*) at
http://cvs.sourceforge.net/viewcvs.p...cs?view=markup

Joannès
(*) the SF may have some delay before displaying the code.
Nov 16 '05 #5

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

Similar topics

3
6184
by: sushi | last post by:
Hello, I have to monitor a remote server for functions such as CPU Utilization etc. I am using System.Management namespace for the same. But when I try to execute the following code, it gives System.UnauthorizedAccessException though the user which I have provided is a valid domain user having administratice rights on that computer.
0
1238
by: E. | last post by:
Hi, i have a problem with remote debug. my local dev computer is a win xp sp 2 (with firewall disabled). my remote server is a win 2k. Both has been configured with my account as administrator. I installed the Remote Debugging Monitor on the remote server + my local dev machine. i configured too the policies so that my account has rights to start the service (on both machines). i run the tool on the remote machine (the visual...
1
3084
by: Ken Allen | last post by:
I have encountered a problem with remote debugging under VS 2005 and ..Net 2.0 -- it seems that the framework installation does not include the "Microsoft .Net Framework 2.0 Configuration" tool! My preferred method of debugging uses these steps: 1. Share the directory that contains the debug image; also share the folder that contains the debug monitor. 2. Configure the project debug mode to launch the exeecutable from the share rather...
0
1249
by: Jason Huang | last post by:
Hi, In my Windows Server 2003 I have installed VS2005, and I have the Visual Studio Remote Debugging Monitor runnig. The Debugging Monitor recorded this line: 3/22/2007 05:37:58PM MyDomain\MyAccount connected. On my Windows XP SP2, I also have the VS 2005. I started a http://Win2003Server'IP/MyWebsite from VS2005 running on my Windows XP.
0
1302
by: DR | last post by:
How to debug sql 2005 on remote machine. I am administrator on both my dev machine and remote sql server machine. I get this error when i try to connect to remote machien with visual studio: unable to connect to microsoft vistual studio remote debugging monitor named msdb3. the microsfot visual studio remote debugging montor (msvsmon.exe) does not appear to be ru nning on the remote computer. please see help for assistance.
6
5081
by: Bob Altman | last post by:
Hi all, This is a long shot, but I figure it doesn't hurt to ask... I have some applications that work fine when I run them on my PC at work, but "fail to initialize (0x000005)" when I'm attached to that PC from home via Remote Desktop. These applications are all console apps written in native C++. The common thread (at this point I've done no serious investigation) seems to be that they all call into a C++/CLI library that, in...
12
9798
by: sakthikumarb | last post by:
Hi , I need to monitor for Remote desktop connection is made for a particular host. There is any WMI event ?.if not how can monitor for remote desktop connection.. (Basically i need to generate a event from remote host that connection is made by xxx user ...) Thanks in advance.. -Sakthi
3
6628
by: Yves Gagnon | last post by:
Hi, I try to debug a WCF hosted in a windows services on a serveur that is on an other domaine then my developpement machine. I tried many things without succes. Here is what I tried: First I installed on the server I want to debug, the remote debugger tools from the VS 2005 CD. I just install the windows application. I tried from there to debug, without succes. I could connect to the remote machine only when the msvsmon.exe is in the...
7
4163
by: luker | last post by:
Hello Experts, I am writing an application for a device running windows xp embedded. I want to code on my developer pc and deploy the running executable to the embedded device. - The two boxes are linked directly by a network cable. - Both are in the same subnetwork and are able to ping each other. - Each box is sharing a directory. - Each box has a remotely shared directory opened in an explorer window. - The development pc is in...
0
10219
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, 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...
0
10049
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 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...
1
9998
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7413
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 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...
0
6675
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5310
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5448
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3967
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
3
2815
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 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...

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.