none
Thread with DLL in C# RRS feed

  • Question

  • Hi All!

    Does anyone know how to create and execute a thread inside a DLL ?
    Is it possible keep the thread running when a program call the DLL ?

    I just wanna create a DLL that will be accessed by couple applications and the DLL should execute a routine which is calling the thread and it is gonna call another method to be run till I desactivate the thread.

    I don't know if it possible, but I would like to create the same action as a timer does, but using threads.

    Thanks a lot!

    Alexander


    Sunday, March 2, 2008 1:56 PM

Answers

  • Hi Alexander,

     

    You can start new thread using one of the following approaches:

    1. Using System.Threading.Thread class

    2. Using System.Threading.ThreadPool class

    3. Using BeginInvoke method of delegate.

     

    Also you can consider using System.Threading.Timer class instead of implementing your own timer logic.

    Sunday, March 2, 2008 2:50 PM

All replies

  • Hi Alexander,

     

    You can start new thread using one of the following approaches:

    1. Using System.Threading.Thread class

    2. Using System.Threading.ThreadPool class

    3. Using BeginInvoke method of delegate.

     

    Also you can consider using System.Threading.Timer class instead of implementing your own timer logic.

    Sunday, March 2, 2008 2:50 PM
  • Hi Vitaliy!

    Thanks for your reply!
    It works pretty well!

    Alexander
    Monday, March 3, 2008 2:02 AM