Group Group Group Group Group Group Group Group Group

Chapter 10: RunLoop never sleeps issue

#1

I believe in chapter 10 the “before” argument to “RunLoop.current.run” in the dedicated thread writer should be “Date.distantFuture” instead of “Date.distantPast”.

With distantPast the CPU is always pegged at 80-90% since the thread never sleeps. With distantFuture the thread always sleeps waiting for a message.

#2

@freak4pc Can you please help with this when you get a chance? Thank you - much appreciated! :]

#3

Hey @jlubawy. We’ve fixed this issue in the 2nd edition of the book, coming soon.
Thanks for your feedback! :slight_smile: