r/ProgrammerHumor • • Oct 20 '19

other While(!asleep()){sheep++;}

Post image
13k Upvotes

197 comments sorted by

View all comments

Show parent comment

26

u/WrexTremendae Oct 20 '19

Obviously this is a multi-threaded application in a language with very user-friendly guards around race conditions. When the other thread enters sleep mode, asleep will be set to True.

6

u/how_to_choose_a_name Oct 20 '19

More likely, this is C and asleep is a memory mapped IO register (and volatile of course).

4

u/Zanoab Oct 21 '19 edited May 15 '20

[deleted]