The answer is simple: "Yes".
And "No".
And "Maybe".
And they are all true at the same time ... it all goes a bit quantum ...
Threading is not simple, if only because it is inherently non-deterministic: you have little or no control over when things happen because the system controls that, subject to the load on the machine and the number of cores you have available to process threads.
Starting a new thread doesn't mean that it runs immediately, it adds it to a "thread pool" of tasks the system needs to do, and when there is a free core and it reaches the top of the list, it will execute. But ... the thread that started the new task is also part of a pool, and Windows is preemptive (which means it will suspend running tasks to give others a chance) so your new thread may run to completion before the Start method returns in the original thread, or it may run at the same time (on a different core) as the original thread code, or it may wait half an hour and then do it's thing.
And you have no significant control over which order is used unless you start coding locks and mutexes etc. to ensure things happen when you expect them to.
So ... given that your
SUB_xxx
values are local to the
yyy
method they could exist or not when your Task actually starts to execute.
Instead of relying on luck to get your values in, pass them as parameters to the task and you guarantee the values the Task will process:
vb.net - Visual Basic .NET: how to create a task from a method with parameters - Stack Overflow[
^]