Skip to content

Meaning of Tree.sleep() #656

Answered by MatteoAlbi
MatteoAlbi asked this question in Q&A
Discussion options

You must be logged in to vote

Answer from @facontidavide :

Since the concept of ticking a tree is basically "polling", we don't want to consume 100% of the cpu, bombarding an asynchronous action with ticks.

The smart thing we do is that the proposed sleep is actually a std::condition_variable in disguise.

So, contrariwise to a regular sleep, it can be interrupted if a wake up signal is sent

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Answer selected by MatteoAlbi
Comment options

You must be logged in to vote
1 reply
@facontidavide
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants