https://bugs.documentfoundation.org/show_bug.cgi?id=100085

--- Comment #3 from Stephan Bergmann <[email protected]> ---
(In reply to jan iversen from comment #2)
> (In reply to Stephan Bergmann from comment #1)
> > > Remark, the wait function in SAL should have a default value of 100 msec,
> > > allowing it to be used for context switching.
> > 
> > ???
> 
> Not all OS are as good as Linux, on e.g. Android and IOS the old function
> "pthread_yield" is still needed, the implementation is normally a simple
> wait.

If there are scenarios that need to call pthread_yield or sched_yield, I would
assume that they do so directly, not trying to mimic that with a call to
osl::Thread::wait.  (And I doubt the implementation of those is "normally a
simple wait"; what sched_yield is defined to do is to "force the running thread
to relinquish the processor until it again becomes the head of its thread
list", per SUSv4).

> In many program parts, there are no definition of how long to wait, so
> setting a default value saves us from having a lot of different times (of
> course with the exception where a specific time is needed).

"git grep -w Thread::wait | wc -l" is 17, and of the ones that are calls
clearly specifying a fixed time, there's:

  2x std::chrono::milliseconds(100)
  3x std::chrono::milliseconds(500)
  1x std::choron::seconds(1)
  1x std::choron::seconds(12)
  1x std::choron::seconds(20)

so not that "many program parts" would benefit from a (somewhat arbitrary)
default there.

-- 
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
Libreoffice-bugs mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs

Reply via email to