Unobtainius Active Member Licensed User Longtime User Apr 8, 2021 #1 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: Copy 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?
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: Copy 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?
Erel B4X founder Staff member Licensed User Longtime User Apr 8, 2021 #2 I guess that one of these subs is a resumable sub. 1. It has nothing to do with threading. 2. It has nothing to do with Android. 3. Watch the resumable subs video tutorial: https://www.b4x.com/etp.html Upvote 0
I guess that one of these subs is a resumable sub. 1. It has nothing to do with threading. 2. It has nothing to do with Android. 3. Watch the resumable subs video tutorial: https://www.b4x.com/etp.html
agraham Expert Licensed User Longtime User Apr 8, 2021 #3 [B4X] How Resumable Subs work | B4X Programming Forum Upvote 0
udg Expert Licensed User Longtime User Apr 8, 2021 #4 @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.. Upvote 0
@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 Longtime User Apr 8, 2021 #5 agraham said: [B4X] How Resumable Subs work | B4X Programming Forum Click to expand... 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 Upvote 0
agraham said: [B4X] How Resumable Subs work | B4X Programming Forum Click to expand... 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