473,385 Members | 1,693 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.

Appdomains and named events

I have a peculiar problem that I am not sure how to solve.

I have a C# application that has 2 appdomains. The default appdomain
just exposes a remoting end point that external applications can call
into if they want to re-start code executing in the other appdomain.
The main thread of the other appdomain creates a named event and waits
on it (while the actual code is executing in other threads). So when
the remoting end point recieves a call to restart the other appdomain,
I just set the named event to signaled state so that the main thread
in the other appdomain is released and the appdomain subsequently
shuts down.

Now.. for reasons we can't do anything about, other external
applications can also shut down that piece of code by directly opening
the named event and setting it.

My question is, is there a way I can distinguish (from inside the C#
application), whether the other appdomain is shut down as a result of
a call received from the remoting endpoint or externally by another
application?

The reason I am asking is, the other appdomain will be relaunched if
it was shut down as a result of a request received from the remoting
endpoint -- if it was shut down as a result of some external
application directly triggering the named event then I want the entire
process to simply shut down, period.

Am I making sense?
Feb 24 '08 #1
1 1668
On Sat, 23 Feb 2008 20:35:58 -0800, Dilip <rd*****@lycos.comwrote:
[...]
Now.. for reasons we can't do anything about, other external
applications can also shut down that piece of code by directly opening
the named event and setting it.

My question is, is there a way I can distinguish (from inside the C#
application), whether the other appdomain is shut down as a result of
a call received from the remoting endpoint or externally by another
application? [...]
I don't know of a way to find out who set the event, though that doesn't
mean there isn't one.

But, can you just use a different named event for the in-process signaling
than for the cross-process signaling? Presumably you can't change the
name used for cross-process signaling, but why not create a different
named event for the internal signaling and use that?

Then you just do the appropriate thing according to which event was
actually signaled?

Pete
Feb 24 '08 #2

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

Similar topics

1
by: Daylor | last post by:
hi. i have mult thread vb.net application. it has 30 threads. each thread serves 1 phone caller. the question : is there a reason , to create appdomain for each Phone Service ? meaning 30...
4
by: Mountain Bikn' Guy | last post by:
I need some advice on this. I am working on a fairly complex calculator app (C#) with lots of functions (and these functions in turn use math functions from an unmanaged C DLL). A calculation takes...
0
by: Brian Takita | last post by:
Hello, I'm getting the following error at the end of this message when trying to run the ReportManager and the ReportServer: Assembly system.data.dll security permission grant set is...
1
by: billr | last post by:
hi there, I hope that someone will be able to shed some light on little old confused me. We are developing an application which will be deployed onto a Terminal Server machine. The application...
8
by: Fred Mertz | last post by:
I'm working towards an MCTS cert and I'm having to learn a bunch of stuff that I doubt I'd stumble across on my own. One such feature of .NET is AppDomains; programatically creating new AppDomains...
0
by: kayakyakr | last post by:
I'm working with a set of experiments in a large system that is using AppDomains for isolation and wants to make a call out to an umanaged dll. The test dll has two methods, SetNumber(int num) and...
3
by: | last post by:
If this is simple, forgive my ignorance, but I'm coming from the CompactFramework where we don't use AppDomains. I did a fair bit of archive searching and couldn't find an answer and I got no...
0
by: jeremyje | last post by:
I would like to create an application where I have many concurrent processes being managed by a monitoring process. Each process that is "managed" will be invoked from an assembly dll (think...
0
by: PRR | last post by:
Here is a code i found on "how to enumerate appdomains in a current process". The original code was posted by Thomas Scheidegger Add the following as a COM reference -...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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:
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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...
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.