> On 12 Jul 2016, at 19:46, Florian Apolloner <[email protected]> wrote: > > On Tuesday, July 12, 2016 at 9:25:37 AM UTC+2, Aymeric Augustin wrote: > Can you check the condition inside the lock? The following pattern seems > simpler to me: > > The standard pattern in such cases is to check inside and outside. Outside to > avoid the lock if you already populated (the majority of requests) and inside > to see if another thread populated it in the time you waited to get the lock…
Yes, actually that’s what I did the last time I implemented this pattern, in Apps.populate. -- Aymeric. -- You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/django-developers. To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/3DF500DF-F5CA-4862-B088-A86C7C1B6628%40polytechnique.org. For more options, visit https://groups.google.com/d/optout.
