[armedbear-devel] CL:SLEEP fixed for sub-millisecond intervals
James M. Lawrence
llmjjmll at gmail.com
Thu Mar 20 22:59:12 UTC 2014
Hi,
The original bug appears to still be there. For example this will hang:
(defun test ()
(let ((object (cons nil nil)))
(threads:synchronized-on object
(threads:object-wait object 0.000000001))))
1.4.0-dev-svn-14653
Java_HotSpot(TM)_Server_VM-Oracle_Corporation-1.7.0_04-b20
i386-Linux-3.2.0-24-generic-pae
--lmj
On Sun, Mar 2, 2014 at 5:08 AM, Mark Evenson <evenson at panix.com> wrote:
> On 2/3/14, 19:14, James M. Lawrence wrote:
> [...]
>>> What would you consider the best option when the timeout value becomes too
>>> close to 0? I see 2:
>>>
>>> 1. Don't wait.
>>> 2. Wait at least 1 ns
>>
>> In the context of bordeaux-threads, I think it would be unexpected if
>> condition-wait did no waiting at all, even if given a timeout that
>> will surely be exceeded. In the limit of the timeout approaching zero,
>> I would say that condition-wait converges to pthread_yield rather than
>> a noop.
>
> [r14362][] fixes CL:SLEEP for intervals less than a millisecond.
>
> For intervals less than or equal to a nanosecond, including an
> interval of zero, the current thread yields execution to other
> threads at James' suggestion.
>
> [r14362]: http://abcl.org/trac/changeset/14632
>
> --
> "A screaming comes across the sky. It has happened before, but there
> is nothing to compare to it now."
>
More information about the armedbear-devel
mailing list