Hi Willy, I agree, setting the flag from the HAProxy USE_THREADS is probably the neatest solution.
I will get a patch over to you later on today. Thanks, Ben Shillito Developer O: +44 1183 287152 E: b...@51degrees.com T: @51Degrees -----Original Message----- From: Willy Tarreau [mailto:w...@1wt.eu] Sent: 21 January 2019 15:44 To: Ben Shillito <b...@51degrees.com> Cc: haproxy@formilux.org Subject: Re: Does anyone *really* use 51d or WURFL ? Hi Ben, First, thanks for your quick response. On Mon, Jan 21, 2019 at 03:05:08PM +0000, Ben Shillito wrote: > Hi Willy, > > I'd like to point out that the 51Degrees API does in fact support > multi-threaded operation by default. The HAProxy makefile however, > explicitly uses the FIFTYONEDEGREES_NO_THREADING compile option to > disable this when building > (https://github.com/haproxy/haproxy/blob/master/Makefile#L740). OK! > Multi-threaded operation in the API is tested under maximum load > before every release as can be seen here: > https://github.com/51Degrees/Device-Detection/blob/master/VisualStudio > /UnitTests/Performance/Base.cs#L89 > > Mutli-threaded operation is also stress tested in conjunction with > many threads detecting User-Agents, and another reloading the data > file repeatedly as seen here: > https://github.com/51Degrees/Device-Detection/blob/master/examples/Rel > oadFromFile.c Oh, rest assured that I have no doubt about the API's support itself, what I mean is that 51d.c in haproxy is not thread-compatible right now (at least due to the makefile entry above and to the test in 51d.c) while haproxy is built with threading on by default, and I find it suspicious that nobody noticed after more than one year. But it's very possible that for now nobody is interested in deploying it with threads. At the moment I'm concerned by the fact that in the whole project there remains exactly two files which are incompatible with thread support and as you can imagine it's always a pain to have to deal with exceptions like this. > If multi-threaded support is an issue, then it is a trivial change to > the makefile to align the HAProxy build to the 51Degrees default, and > give the option to disable threading for those who require that. Excellent! What I can suggest then is to set this define only when USE_THREAD is not set. This way you can make sure that 51d.c and the rest of haproxy are always aligned regarding thread support. Feel free to send a patch, I'll happily merge it and even backport it so that we don't have to worry anymore about the compatbility between threads and various options. Thanks! Willy This email and any attachments are confidential and may also be privileged. If you are not the named recipient, please notify the sender immediately and do not disclose, use, store or copy the information contained herein. This is an email from 51Degrees.mobi Limited, 5 Charlotte Close, Reading. RG47BY. T: +44 118 328 7152; E: i...@51degrees.com; 51Degrees.mobi Limited t/as 51Degrees.