Results 1 to 5 of 5

Thread: Thread doesn't do anything

  1. #1

    Thread Starter
    Hyperactive Member greg_quinn's Avatar
    Join Date
    Nov 2002
    Location
    South Africa
    Posts
    366

    Thread doesn't do anything

    I have a Sub called SendMessages() that is supposed to do some database work and send an email message in my web app.

    Now if I call it directly, it does what it should. I've now been trying to place this Sub into a thread of its own..

    i.e

    Dim sendMessageThread as New Thread(AddressOf SendMessages)
    sendMessageThread.Start()

    But the page ends up doing nothing...

    Any ideas?
    He who has conquered himself, is far greater than he who has conquered a thousand men... - The Buddha

  2. #2
    Frenzied Member Memnoch1207's Avatar
    Join Date
    Feb 2002
    Location
    DUH, Guess...Hint: It's really hot!
    Posts
    1,861

    Re: Thread doesn't do anything

    Is your SendMessages sub within the same class or in another class?
    Have you stepped through your code to see if the thread is entering the sub?
    Being educated does not make you intelligent.

    Need a weekend getaway??? Come Visit

  3. #3

    Thread Starter
    Hyperactive Member greg_quinn's Avatar
    Join Date
    Nov 2002
    Location
    South Africa
    Posts
    366

    Re: Thread doesn't do anything

    It is in the same class. I'm not using VS.NET so I can't do any stepping...

    The thread is being called from Page_Load()
    He who has conquered himself, is far greater than he who has conquered a thousand men... - The Buddha

  4. #4
    Frenzied Member Memnoch1207's Avatar
    Join Date
    Feb 2002
    Location
    DUH, Guess...Hint: It's really hot!
    Posts
    1,861

    Re: Thread doesn't do anything

    Post the code.
    Being educated does not make you intelligent.

    Need a weekend getaway??? Come Visit

  5. #5

    Thread Starter
    Hyperactive Member greg_quinn's Avatar
    Join Date
    Nov 2002
    Location
    South Africa
    Posts
    366

    Re: Thread doesn't do anything

    As far as it seems, the Sub ReceiveMessages is not being called at all!!!
    Here is my code

    Sub Page_Load()
    Dim NewThread As Thread = New Thread(AddressOf ReceiveMessages)

    NewThread.Priority = ThreadPriority.Lowest
    NewThread.Start()
    End Sub

    Public Sub ReceiveMessages()
    ' Code here to connect to pop3 server and loop through messages
    End Sub
    He who has conquered himself, is far greater than he who has conquered a thousand men... - The Buddha

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width