Skip to Content.
Sympa Menu

coq-club - Re: [Coq-Club] set_timeout in 8.8.0

coq-club AT inria.fr

Subject: The Coq mailing list

List archive

Re: [Coq-Club] set_timeout in 8.8.0


Chronological Thread 
  • From: Jacques-Henri Jourdan <jacques-henri.jourdan AT normalesup.org>
  • To: coq-club AT inria.fr
  • Subject: Re: [Coq-Club] set_timeout in 8.8.0
  • Date: Mon, 7 May 2018 17:12:26 +0200
  • Authentication-results: mail2-smtp-roc.national.inria.fr; spf=None smtp.pra=jacques-henri.jourdan AT normalesup.org; spf=Neutral smtp.mailfrom=jacques-henri.jourdan AT normalesup.org; spf=None smtp.helo=postmaster AT ulminfo.fr
  • Autocrypt: addr=jacques-henri.jourdan AT normalesup.org; prefer-encrypt=mutual; keydata= xsBNBE3aB7YBCAC2UZ+cvI7Ql69Nj67pWyvmesd0cek5SI2Pzv01Nnqm1HscmKOmqUoRMRi5 W1t3VjvMBD2N+d/k/BF1S9/nI7FIa1NVwTc1zW4+DbN6avxBORFtqqpcKk6rzltB7anOe4PP YNsWwP0H/lZhhJuhG0N/2xEJnYJW+ZpU815LAOz9NXpktsWuQf3nNTA62MrFc4URdGKXuVaT wHYxRMl0wPz+uKUnCngQb6RsWIVv4/Jt/2XCjfa2eORS+qLV4shJo5O4gcNP/mFREp1nfnj/ zAi8Ioqxhkp5P/ogw73Yvek5i3IXuKtRfrdDFQgp51//G9viYCLRibTex5dfW3XldOhPABEB AAHNPEphY3F1ZXMtSGVucmkgSm91cmRhbiA8amFjcXVlcy1oZW5yaS5qb3VyZGFuQG5vcm1h bGVzdXAub3JnPsLAggQTAQgALAIbIwUJDrw4UAcLCQgHAwIBBhUIAgkKCwQWAgMBAh4BAheA BQJW/rWhAhkBAAoJEGHoGlEY1GjFT44H/1PuNJSHVA5ZPfRiYh6d9Ggzpjhpv/i76t5l5NrF AaSNvWkBA31xeOCC6+zbpS35Me9Ng4nmjgJH2F9k+TZLkanFiAvj90BYMgFORTPjRscyItTy ypj/AyjLgOT5bU/S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AyP7llj6gLWIekgk4OSl6urqb7P7rZGGLYB0kBvxMqE2l8y/H+s4Ng8OUnCG+eS40b3j/Ev5QLtNjvEsnKnZqojWJcUdpqGnHw9YyoYu5wyiAzqo0NkUh2QLIVFGdR6dkoTkNVXDLOj9DfilglSslDlrx+rBPr3kGpjNLGLMn6v4fbZg9UFc0xM/zdBB6JJSELEBIej/Wk32tNzFFB82Lha7w+D8BdV70YMeQ2ePDbWdMKzMql+I+/ovL/OLZI8PtzbxM+Il6OL2jX8lhV8derGk0ocQaHChB/hpP0GZYWf3jdoaCmcLvg8+TPTwh1GYUD5TYWyyX6Mm6T0hBoKmF9SLeof4i7uYmSy/A5d+Z2ZcC1nKH227WZ+DXqIuYSmLP8J61xwJU6KgA60myAuivQmyn7huJfPJ9zZdtZ/lztkz5erOjx078xRyCN6Y2mWAVHxs2GQSSGllj+hEvUVhxwLbguBDiPtCGIkLvqIbYkIBLZfZitdCJZX3UwPFcM2OTQ/4ENOhGzQ4St8q3sdIZFxySY/70kLzmhGyCrpQrISlQYQu+/uCjX72PcN0z3vdybFniEMpEJMWaD+Ww5Vn/g2WPLbn1kWUk6HzL/YB2CvM8mmEi2SU7hlV
  • Openpgp: preference=signencrypt

Hi Gabriel,

The OCaml bug in question is the following:

https://caml.inria.fr/mantis/view.php?id=7709

As we discussed and diagnosed the problem at POPL, the problem is that
the timeout system is based on signals, and the OCaml runtime is not
able to masks signals per threads while POSIX is. I plan to work on this
at some point, but I have been too busy in the meantime.

--
JH



Le 07/05/2018 à 11:41, Gabriel Scherer a écrit :
> If you believe there is a bug in the OCaml runtime, have you reported
> an issue on the OCaml bugtracker ( http://caml.inria.fr/mantis/ )? I
> haven't found any related issue.
>
> After looking at this out of curiosity, I don't think that "Coq's
> timeout function is broken because of a bug in the OCaml runtime" is a
> fair description of the situation.
>
> My understanding of Coq's lib/control.ml code (
> https://github.com/coq/coq/blob/629fbc7/lib/control.ml ) is that there
> are two timeout functions, one for Windows, which spins a separate
> timer thread, and one for Linux which uses Unix.alarm. It seems
> generally well-known¹ that, following POSIX, "alarm" is process-level
> and may deliver the SIGALRM signal to any thread² that does not
> explicity block it -- I don't think the OCaml runtime is supposed to
> give any stronger guarantees than POSIX on these system calls.
>
> ¹: See for example
> http://maxim.int.ru/bookshelf/PthreadsProgram/htm/r_40.html
> ²: In that respect the "Management of signals" paragraph in the OCaml
> manual ( http://caml.inria.fr/pub/docs/manual-ocaml/libref/Thread.html
> ) might be misleading; it talks about synchronous signals, and maybe
> it is not clear that alarms are an "external" signal.
>
> My non-expert understanding would thus be that Coq's signal-based
> timeout implementation is not actually reliable for multi-threaded
> usage, and that maybe the Coq developers could consider using the
> thread-based implementation (currently Windows-only) more often. Does
> it impact the performance in an important way? (It may also be
> possible to use a signal-based implementation by ensuring that all
> threads block the SIGALRM signal by default, and only unblocking the
> signal before calling "timeout"; this requires using a mutex to
> protect "timeout" calls, although it is possible to revert to the
> thread-based implementation when the mutex is held by another thread
> instead of blocking.)
>
>
> On Thu, May 3, 2018 at 12:27 PM, Łukasz Czajka
> <lukaszcz AT mimuw.edu.pl>
> wrote:
>> Hi.
>>
>> Our usecase is that Coq's timeout function is broken because of a bug
>> in OCaml runtime, and we wrote our own a bit less broken version for
>> the CoqHammer plugin.
>>
>> Best,
>> Lukasz
>>
>>
>> On 2 May 2018 at 20:41, Emilio Jesús Gallego Arias
>> <e AT x80.org>
>> wrote:
>>> Burak Ekici
>>> <ekcburak AT hotmail.com>
>>> writes:
>>>
>>>> The latest release of Coq (8.8.0) seems to drop the "set_timeout"
>>>> function from "control.ml". How can I simply mimic it? We want to use a
>>>> particular timeout function...
>>> Umm, that function was pretty internal so I wonder what your use case
>>> is. Please open a ticket on GitHub and we will add the interface back
>>> for 8.8.1
>>>
>>> E.


Attachment: signature.asc
Description: OpenPGP digital signature




Archive powered by MHonArc 2.6.18.

Top of Page