Is there ever 2 portions of code being executed simultaneously? If an event is raised in middle of execution some code in a sub will that event immediately be processed simultaneously, is the sub stopped, or is the sub finished and the event processed?
If an event is raised in middle of execution some code in a sub will that event immediately be processed simultaneously, is the sub stopped, or is the sub finished and the event processed?
How is this handled in the case of a service running at the same time? If an event is raised in a service, is it simply added next in line to the same queue?
There is nothing special about services. The code is executed by the main thread and behaves exactly like code in any other module.
The only difference is that the the service itself is never paused.
Sub Button1_Click
'do something
For i = 1 To 100
CallAnotherSub(100)
Next
End Sub
No event will be raised until Button1_Click completes.
There is nothing special about services. The code is executed by the main thread and behaves exactly like code in any other module.
The only difference is that the the service itself is never paused.