3 Matching Annotations
  1. Sep 2024
    1. In practice, forks and threads are at odds with each other. If you try to fork while there are active threads, you will very likely run into bugs. Even if you didn't create the thread, some other library might have, so it can be very tricky in practice.
    1. If you'd like another method to do the waiting for you, e.g. Kernel.select, you can use Timers::Group#wait_interval to obtain the amount of time to wait. When a timeout is encountered, you can fire all pending timers with Timers::Group#fire

      This is another way of achieving concurrency (progress made while waiting for other things) besides wrapping the timer's sleep in a separate thread like https://github.com/rubyworks/facets/blob/main/lib/standard/facets/timer.rb does.

    1. A concurrent system is one where a computation can advance without waiting for all other computations to complete.