Forum > Linux

Sleep

(1/1)

scasparz:
Am Linux Mint running the latest Lazarus.

Just a simple question: have an application running a number of threads, that seem to work well.
Of course calling tthread.Sleep will put the corresponding thread to sleep.
However, calling Sleep on the main thread does this mean that both the main thread as well the child threads are placed to sleep as well?


kind regards
s

Red_prig:
No, it only puts to sleep the thread in which the function is called.

MarkMLl:
Note that Sleep() works at the OS kernel level, while a TTimer etc. works at the GUI level.

I'd also note that it's bad form to put any sort of kernel-level delay or blocking call in the main (GUI) thread, since it will prevent the message loop from running and leave the user interface unresponsive.

The fact that you're asking about threads suggests that you've already got fairly good ideas how to work round that sort of thing :-)

MarkMLl

Navigation

[0] Message Index

Go to full version