F
fiefie.niles
I am using a thread. Inside the thread there is a sub ThreadMain. I am
calling the thread from the main program MainForm.
Inside the thread, if I am calling a sub (say doProcess) from the
MainForm, does it mean that doProcess is processed inside or outside
the thread ?
Code from MainForm:
Public Class MainForm
Private Session As ClientSession = Nothing
Private WorkerThread As Threading.Thread = Nothing
Public Sub ConnectMenu_Click
:
' Create a new instance of the ClientSession object and a
worker
' thread that will handle the socket I/O
Session = New ClientSession
WorkerThread = New Threading.Thread(AddressOf
Session.ThreadMain)
Session.ClientForm = Me
' Initialize the worker thread and start its execution
WorkerThread.Name = "WorkerThread"
WorkerThread.Start()
Code from the thread:
Public Class ClientSession
Public ClientForm As MainForm = Nothing
Public Sub ThreadMain()
:
ClientForm.doProcess(strBuffer) --->will this be executed inside or
outside the thread ?????
:
Thanks.
calling the thread from the main program MainForm.
Inside the thread, if I am calling a sub (say doProcess) from the
MainForm, does it mean that doProcess is processed inside or outside
the thread ?
Code from MainForm:
Public Class MainForm
Private Session As ClientSession = Nothing
Private WorkerThread As Threading.Thread = Nothing
Public Sub ConnectMenu_Click
:
' Create a new instance of the ClientSession object and a
worker
' thread that will handle the socket I/O
Session = New ClientSession
WorkerThread = New Threading.Thread(AddressOf
Session.ThreadMain)
Session.ClientForm = Me
' Initialize the worker thread and start its execution
WorkerThread.Name = "WorkerThread"
WorkerThread.Start()
Code from the thread:
Public Class ClientSession
Public ClientForm As MainForm = Nothing
Public Sub ThreadMain()
:
ClientForm.doProcess(strBuffer) --->will this be executed inside or
outside the thread ?????
:
Thanks.