zxing-cpp icon indicating copy to clipboard operation
zxing-cpp copied to clipboard

Not thread safe?

Open skylook opened this issue 10 years ago • 2 comments

As there are so many static functions and members, I think zxing is not thread safe. Any body know how to make it thread safe?

skylook avatar Nov 10 '15 08:11 skylook

Well, static functions aren't an issue, but static functions with side effects (e.g. modifying static members) certainly are.

We (Glass Echidna) didn't write zxing-cpp, we're just maintaining a centralised location for people to submit patches. So please don't blame us for the terrible code :wink:

This library is stable enough to use in most cases (I've been using it in production systems for over a year), however from a code quality stand-point I think the project is beyond redemption. If you want to drastically modify it (say make things thread safe), I think you'd be better off performing an entire rewrite and simply use zxing-cpp for reference purposes.

If someone were to do so I'm sure they'd be very popular indeed!

Benjamin-Dobell avatar Nov 10 '15 08:11 Benjamin-Dobell

It's not thread safe. I would say it's 'quite' safe though if you are running a thing or two parallel. Making it thread safe wouldn't be that big of a hassle. Static functions by themselves has little to do with thread safety.

TimZaman avatar Feb 09 '16 18:02 TimZaman