Skip to content
Snippets Groups Projects
  1. Jan 17, 2023
  2. Jan 04, 2023
  3. Dec 17, 2022
  4. Dec 02, 2022
  5. Jul 29, 2022
  6. Jun 22, 2022
  7. Apr 03, 2022
  8. Feb 10, 2022
  9. Jan 14, 2022
  10. Jan 13, 2022
  11. Nov 24, 2021
  12. Nov 15, 2021
  13. Nov 06, 2021
  14. Nov 02, 2021
  15. Oct 22, 2021
    • Nat Goodspeed's avatar
      SL-16220: Add LL::ThreadPool class and a "General" instance. · 11afa09e
      Nat Goodspeed authored
      ThreadPool bundles a WorkQueue with the specified number of worker threads to
      service it. Each ThreadPool has a name that can be used to locate its
      WorkQueue.
      
      Each worker thread calls WorkQueue::runUntilClose().
      
      ThreadPool listens on the "LLApp" LLEventPump for shutdown notification. On
      receiving that, it closes its WorkQueue and then join()s each of its worker
      threads for orderly shutdown.
      
      Add a settings.xml entry "ThreadPoolSizes", the first LLSD-valued settings
      entry to expect a map: pool name->size. The expectation is that usually code
      instantiating a particular ThreadPool will have a default size in mind, but it
      should check "ThreadPoolSizes" for a user override.
      
      Make idle_startup()'s STATE_SEED_CAP_GRANTED state instantiate a "General"
      ThreadPool. This is function-static for lazy initialization.
      
      Eliminate LLMainLoopRepeater, which is completely unreferenced. Any potential
      future use cases are better addressed by posting to the main loop's WorkQueue.
      
      Eliminate llappviewer.cpp's private LLDeferredTaskList class, which
      implemented LLAppViewer::addOnIdleCallback(). Make addOnIdleCallback() post
      work to the main loop's WorkQueue instead.
      11afa09e
  16. Oct 07, 2021
    • Nat Goodspeed's avatar
      SL-16024: Add LL::WorkQueue for passing work items between threads. · 623ac791
      Nat Goodspeed authored
      A typical WorkQueue has a string name, which can be used to find it to post
      work to it. "Work" is a nullary callable.
      
      WorkQueue is a multi-producer, multi-consumer thread-safe queue: multiple
      threads can service the WorkQueue, multiple threads can post work to it.
      
      Work can be scheduled in the future by submitting with a timestamp. In
      addition, a given work item can be scheduled to run on a recurring basis.
      
      A requesting thread servicing a WorkQueue of its own, such as the viewer's
      main thread, can submit work to another WorkQueue along with a callback to be
      passed the result (of arbitrary type) of the first work item. The callback is
      posted to the originating WorkQueue, permitting safe data exchange between
      participating threads.
      
      Methods are provided for different kinds of servicing threads. runUntilClose()
      is useful for a simple worker thread. runFor(duration) devotes no more than a
      specified time slice to that WorkQueue, e.g. for use by the main thread.
      623ac791
  17. Oct 05, 2021
    • Nat Goodspeed's avatar
      SL-16024: Add ThreadSafeSchedule, a timestamped LLThreadSafeQueue. · 955b9676
      Nat Goodspeed authored
      ThreadSafeSchedule orders its items by timestamp, which can be passed either
      implicitly or explicitly. The timestamp specifies earliest delivery time: an
      item cannot be popped until that time.
      
      Add initial tests.
      
      Tweak the LLThreadSafeQueue base class to support ThreadSafeSchedule:
      introduce virtual canPop() method to report whether the current head item is
      available to pop. The base class unconditionally says yes, ThreadSafeSchedule
      says it depends on whether its timestamp is still in the future.
      
      This replaces the protected pop_() overload accepting a predicate. Rather than
      explicitly passing a predicate through a couple levels of function call, use
      canPop() at the level it matters. Runtime behavior that varies depending on
      an object's leaf class is what virtual functions were invented for.
      
      Give pop_() a three-state enum return so pop() can distinguish between "closed
      and empty" (throws exception) versus "closed, not yet drained because we're
      not yet ready to pop the head item" (waits).
      
      Also break out protected tryPopUntil_() method, the body logic of
      tryPopUntil(). The public method locks the data structure, the protected
      method requires that its caller has already done so.
      
      Add chrono.h with a more full-featured LL::time_point_cast() function than the
      one found in <chrono>, which only converts between time_point durations, not
      between time_points based on different clocks.
      955b9676
  18. Oct 04, 2021
  19. Sep 23, 2021
  20. Sep 08, 2021
  21. Sep 03, 2021
  22. Sep 01, 2021
  23. Aug 09, 2021
  24. Aug 08, 2021
  25. Jul 28, 2021
  26. Jul 27, 2021
  27. Jun 20, 2021
  28. Jun 07, 2021
  29. Apr 18, 2021
  30. Apr 05, 2021
  31. Mar 16, 2021
  32. Jan 22, 2021
Loading