473,474 Members | 1,727 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

MethodInfo.Invoke called process: possible to stop run?

Hi.

I'm trying to implement some kind of plugin manager and call functions
in remote loaded libraries in seperate AppDomains to be able to unload
the DLLs) via MethodInfo.Invoke(). So far, so fine. But I call some
long running functions this way an want to stop this calls, but have
no idea how to do this. Is it possible and how, or should I use a
different approach?

Thanks in advance,
Florian
Dec 4 '07 #1
3 2019
Florian,

If your methods have no hooks in them which allow them to receive a
signal, then you will have to execute those methods in another thread, and
then abort the thread.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

<fl************@googlemail.comwrote in message
news:c4**********************************@s36g2000 prg.googlegroups.com...
Hi.

I'm trying to implement some kind of plugin manager and call functions
in remote loaded libraries in seperate AppDomains to be able to unload
the DLLs) via MethodInfo.Invoke(). So far, so fine. But I call some
long running functions this way an want to stop this calls, but have
no idea how to do this. Is it possible and how, or should I use a
different approach?

Thanks in advance,
Florian

Dec 4 '07 #2
<fl************@googlemail.comwrote:
I'm trying to implement some kind of plugin manager and call functions
in remote loaded libraries in seperate AppDomains to be able to unload
the DLLs) via MethodInfo.Invoke(). So far, so fine. But I call some
long running functions this way an want to stop this calls, but have
no idea how to do this. Is it possible and how, or should I use a
different approach?
It's better to do this co-operatively, via a plugin interface which has
a method to tell the long-running tasks that you wish to stop. That way
they will be able to shut down gracefully, cleaning up resources etc.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
World class .NET training in the UK: http://iterativetraining.co.uk
Dec 4 '07 #3
Nicholas Paldino [.NET/C# MVP]
It's better to do this co-operatively, via a plugin interface which has
a method to tell the long-running tasks that you wish to stop. That way
they will be able to shut down gracefully, cleaning up resources etc.

--
Jon Skeet - <sk...@pobox.com>http://www.pobox.com/~skeet Blog:http://www.msmvps.com/jon.skeet
World class .NET training in the UK:http://iterativetraining.co.uk

The approach to use a plug-in interface to co-operatively
abort sounds good to me, I try to work this out.

Thanks a lot for your fast responses,
Florian
Dec 4 '07 #4

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

Similar topics

5
by: Stephen Lamb | last post by:
I have a background worker thread which I start from a form's HandleCreated event that makes calls back to the form using Invoke. During shutdown the form is disposed and the background worker...
3
by: Me | last post by:
I am trying to figure out any issues with calling System.Reflection.MethodInfo.Invoke() when dealing with multiple threads. For instance.. Say I have a class that allows you to pass in a...
15
by: =?Utf-8?B?VG9tIENvcmNvcmFu?= | last post by:
I've been led to believe by several articles, particularly Eric Gunnerson's C# Calling Code Dynamically, that calling a method dynamically through Reflection was much slower than through a...
11
by: KMinFL | last post by:
This is a C# VS 2008 question... Our system has 2 base classes, SingleEntity and NewPluralEntity. SingleEntity provides access to properties and methods related to manipulating data in a database...
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...
1
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...
0
tracyyun
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...
1
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...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
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 ...
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.