[Rpm-maint] [rpm-software-management/rpm] Fix excessive use of thread local storage (RhBug:1722181) (#759)

Colin Walters notifications at github.com
Thu Jun 20 13:08:20 UTC 2019


LGTM.   Regarding

> The __thread uses in rpmsq don't make sense at all in reality, so better revert and rethink from scratch.

I don't know what all is writing/reading to those variables but, global mutable statics are basically always wrong.  In Rust for example a common pattern is `lazy_static!` + `Mutex`, like [this bit of code in rpm-ostree](https://github.com/projectatomic/rpm-ostree/blob/c94bd08b02499a3f2a5804f5c2ba207a0afbda18/rust/src/progress.rs#L50).

(Or of course for integer variables like thise atomics can be used)


-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/759#issuecomment-504019053
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rpm.org/pipermail/rpm-maint/attachments/20190620/f05332c0/attachment.html>


More information about the Rpm-maint mailing list