[Xapian-tickets] [Xapian] #769: Provide more options for lock retrying

Xapian nobody at xapian.org
Tue May 9 01:58:12 BST 2023


#769: Provide more options for lock retrying
-------------------------+-------------------------------
 Reporter:  bremner      |             Owner:  Olly Betts
     Type:  enhancement  |            Status:  new
 Priority:  normal       |         Milestone:
Component:  Other        |           Version:
 Severity:  normal       |        Resolution:
 Keywords:               |        Blocked By:
 Blocking:               |  Operating System:  All
-------------------------+-------------------------------
Comment (by Olly Betts):

 > A "sleeper thread" could probably also be used to implement the match
 timeout on platforms where timer_create() isn't usable (or maybe
 everywhere even).

 I had a look at implementing that, and came up with a working prototype
 using pthreads.  See #770.

 I also worked out why our `timer_create()` based timeout doesn't work on
 NetBSD - it doesn't implement `SIGEV_THREAD`.

 I think we want to avoid using `timer_create()` more.  It's not supported
 at all on some platforms, and `SIGEV_THREAD` isn't supported on others.
 `SIGEV_SIGNAL` is probably a bit better, but more visible to the
 application.

 I think better to create a "timeout" thread which uses `sleep()` (or some
 variant with better granularity) and then kills the thread blocked on the
 lock.  That may need C++20 if we want to use C++ threads (otherwise we
 need to deal with pthreads, which needs special options on some platforms,
 and also handle platforms without pthreads).  I'll try to get the
 `Enquire::set_time_limit()` thread-based implementation merged first.
-- 
Ticket URL: <https://trac.xapian.org/ticket/769#comment:3>
Xapian <https://xapian.org/>
Xapian


More information about the Xapian-tickets mailing list