Background tasks using SharedObjects
- New
- How-to
-
Bernhard Stoeter
- PowerBuilder
- Tuesday, 23 December 2025 08:50 AM UTC
Hi together,
I start a background task (is uses a “callback” nvo):
…
for li_I = 1 to 1024
OutputDebug( string( li_I ))
Sleep(1)
end for
…
Watching the output via SysInternals DebugViewer shows that it works as expected: 1, 2, 3, … every second.
When I call i.e. Sleep(5) in the foreground/GUI task the execution of the background task is interrupted and continues running after 5 seconds.
What is the reason for this behaviour and how can I “sleep” the foreground/GUI task without disturbing the background task (same process id different thread id)?
Btw: Using Windows Kernel32.dll sleep() I run into the same problem.
Thanks in advance,
Bernhard
Find Questions by Tag
Helpful?
If a reply or comment is helpful for you, please don’t hesitate to click the Helpful button. This action is further confirmation of their invaluable contribution to the Appeon Community.