Android Question Clarification required re general android program flow

Unobtainius

Active Member
Licensed User
my background is windows desktop and in general it is very procedural in that each line is executed in the order it is presented.
The flowing sub would execute every line myFakeProc1 before proceeding to MyFakeProc2 (* unless of course I run each procedure in its own thread, which i have to go out of my way to do)
B4X:
Private Sub DoSomething()
    myFakeProc1
    myFakeProc2
End Sub
my impression of this language is that myFakeProc2 is started immediately after myFakeProc1 while myFakeProc1 may in fact still be executing
Hence we use wait for to ensure the statements that follow it are not executed until the wait for procedure is completed

If this is case, for me it feels like it uses threading inherently, so I'm wondering why there is also a threading library?
 

udg

Expert
Licensed User
@agraham : one of the best explanations on that topic I've ever read! I can't understand how it's possible that I missed it until today..
 

Unobtainius

Active Member
Licensed User
Thanks for the link. It was very informative. My Initial assumption was incorrect. Execution is exactly as any other language I have used. I think my confusion arose from calling library routines that must have been resemble subs without me realising it. That would explain why execution was returned to my calling sub before I was expecting it as eluded to by @Erel . This is why I use wait for a lot these days
Thank you both for your input
 
Top