glassechidna / zxing-cpp

ZXing C++ Library
Apache License 2.0
598 stars 435 forks source link

Not thread safe? #34

Open skylook opened 8 years ago

skylook commented 8 years ago

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?

Benjamin-Dobell commented 8 years ago

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!

TimZaman commented 8 years ago

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.