About multithreading

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Serge Bollaerts

    #1

    About multithreading

    Hello everybody,

    I'm creating (Hum... trying to:) a small proxy server based on a sample I
    found on the net. Could someone explain me the difference between
    clientThread1 and clientThread2?? ? There something mystic I cannot
    realize...

    Dim clientRequest As New ProxyClient(_sv rSocket.AcceptS ocket())
    Dim clientThread1 As New Thread(AddressO f clientRequest.P rocess)
    Dim clientThread2 As New Thread(New ThreadStart(Add ressOf
    clientRequest.P rocess))

    Thanks a lot,
    Serge


  • Dave

    #2
    Re: About multithreading

    According to the documentation for the ThreadStart delegate VB will
    automatically call the ThreadStart constructor for you. clientThread1 and 2
    will execute the same code on two different threads.

    "Serge Bollaerts" <serge@deepblue eyes.net> wrote in message
    news:3f23a75f$0 $275$ba620e4c@r eader1.news.sky net.be...[color=blue]
    > Hello everybody,
    >
    > I'm creating (Hum... trying to:) a small proxy server based on a sample I
    > found on the net. Could someone explain me the difference between
    > clientThread1 and clientThread2?? ? There something mystic I cannot
    > realize...
    >
    > Dim clientRequest As New ProxyClient(_sv rSocket.AcceptS ocket())
    > Dim clientThread1 As New Thread(AddressO f clientRequest.P rocess)
    > Dim clientThread2 As New Thread(New ThreadStart(Add ressOf
    > clientRequest.P rocess))
    >
    > Thanks a lot,
    > Serge
    >
    >[/color]


    Comment

    Working...