From mboxrd@z Thu Jan 1 00:00:00 1970 From: mathieu.desnoyers@efficios.com (Mathieu Desnoyers) Date: Mon, 20 Aug 2018 15:48:35 -0400 (EDT) Subject: [lttng-dev] [RFC] wfcqueue: allow defining CDS_WFCQ_WAIT_SLEEP to override `poll' In-Reply-To: <20180817203134.zhvzvddsdtv54wg5@dcvr> References: <20180801185445.mcvkvxmhqm5hflrj@dcvr> <1597828270.1143.1534169594018.JavaMail.zimbra@efficios.com> <20180817203134.zhvzvddsdtv54wg5@dcvr> Message-ID: <421142351.3072.1534794515817.JavaMail.zimbra@efficios.com> ----- On Aug 17, 2018, at 4:31 PM, Eric Wong normalperson at yhbt.net wrote: > Mathieu Desnoyers wrote: >> ----- On Aug 1, 2018, at 2:54 PM, Eric Wong normalperson at yhbt.net wrote: >> >> > Users may want to use alternative sleeping behavior instead of >> > `poll'. Make CDS_WFCQ_WAIT_SLEEP a macro which may be defined >> > before including wfcqueue.h. >> > >> > This alternative behavior could include logging, performing >> > low-priority cleanup work, sleeping a shorter/longer interval >> > or any combination of that. >> > >> > This will also make integration into glibc easier, as `poll' >> > linkage causes conformance test failures even when relegated >> > to an impossible code path: >> > https://public-inbox.org/libc-alpha/20180801092626.jrwyrojfye4avcis at whir/ >> >> Rather than introducing a macro here, can we extend the API to >> pass a callback and a private pointer that would perform the >> sleeping behavior requested by the caller ? > > Given this is deep in the call stack, it would require modifying > a lot of callers. So it seems like a compatibility/migration > nightmare. I fear it's too much work for a small improvement. > > For glibc, we can simply define `poll' to `__poll' to avoid > those test failures, at least I merged the patch you proposed, it makes sense considering the context. Thanks! Mathieu -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com