Skip to content

Releases: pmmp/Snooze

0.5.0

22 May 23:50
a86d9ee
Compare
Choose a tag to compare

Changes since 0.4.x

General

  • PHP 8.1 or newer is now required.
  • ext-pmmpthread 6.0 or newer is now required.

API changes

  • SleeperHandler::addNotifier() now returns SleeperHandlerEntry. This is a thread-safe object used to create SleeperNotifier, and should be passed to the destination thread.
  • SleeperHandler::addNotifier() no longer accepts SleeperNotifier. Notifiers are now created using SleeperHandlerEntry::createNotifier().
  • SleeperHandler::removeNotifier() now accepts int $notifierId. This allows the main thread to retain only the notifier ID for later cleanup, saving memory.
  • SleeperNotifier is no longer thread-safe, and must be instantiated within the destination thread using SleeperHandlerEntry::createNotifier(). Since the notification delivery does not require the notifier itself to be a thread-safe object, this allows for better performance by avoiding unnecessary locking and the inherent overhead of thread-safe objects.

0.4.0

23 Jan 19:45
6b1d6cc
Compare
Choose a tag to compare

Changes since 0.3.1

  • pthreads ^5.0 is now required.

0.3.1

01 Nov 20:52
0ac8fc2
Compare
Choose a tag to compare

Changes since 0.3.0

  • Accept pthreads ~3.2.0 || ^4.0.

0.1.6

01 Nov 20:51
92abf1e
Compare
Choose a tag to compare

Changes since 0.1.5

  • Accept pthreads ~3.2.0 || ^4.0.

0.3.0

13 Jun 14:18
fe5b1db
Compare
Choose a tag to compare

Changes since 0.2.0

  • SleeperHandler now only accepts Closure for handlers, not callable. (You can use Closure::fromCallable() to convert a callable to a closure.)
  • Improved performance of SleeperNotifier->wakeupSleeper() (less locking).
  • SleeperHandler no longer keeps references to SleeperNotifier instances (not needed). NotifierEntry has therefore been removed.

0.2.0

06 May 11:11
13ff76e
Compare
Choose a tag to compare

Changes since 0.1.5

  • The use of a thread-safe map for tracking notifications (instead of flags on each notifier) improves performance substantially:
    • Notification processing with large numbers of notifiers is much faster, since it's not required to synchronize with and bruteforce-search for notifiers causing a wakeup (less locks, and also less CPU time wasted).
    • Less locks are required during delivery of notifications (locks only required on the shared object and not on notifiers).