MethodInfo.Invoke called process: possible to stop run?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • florian.grimps@googlemail.com

    #1

    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.Invo ke(). 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
  • Nicholas Paldino [.NET/C# MVP]

    #2
    Re: MethodInfo.Invo ke called process: possible to stop run?

    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]
    - mvp@spam.guard. caspershouse.co m

    <florian.grimps @googlemail.com wrote in message
    news:c4db3f29-a216-4797-9e62-e2fabbf359d5@s3 6g2000prg.googl egroups.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.Invo ke(). 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

    Comment

    • Jon Skeet [C# MVP]

      #3
      Re: MethodInfo.Invo ke called process: possible to stop run?

      <florian.grimps @googlemail.com wrote:
      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.Invo ke(). 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 - <skeet@pobox.co m>
      http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
      World class .NET training in the UK: http://iterativetraining.co.uk

      Comment

      • florian.grimps@googlemail.com

        #4
        Re: MethodInfo.Invo ke called process: possible to stop run?

        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.co m>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

        Comment

        Working...