Skip to content
This repository has been archived by the owner on Apr 6, 2021. It is now read-only.

This client library has widespread thread safety issues #112

Open
fhriley opened this issue Oct 13, 2017 · 0 comments
Open

This client library has widespread thread safety issues #112

fhriley opened this issue Oct 13, 2017 · 0 comments

Comments

@fhriley
Copy link
Contributor

fhriley commented Oct 13, 2017

Following on to issue #109, I figured I should look to see if these same thread safety issues were in other parts of this library. Sure enough, the first two classes I looked at, UtilEmitter and UtilAckTimeoutRegistry, both have these same kinds of thread safety issues. They do use Concurrent* collections in a lot of places, but that alone does not make them thread safe. For example, this seems to be common:

Concurrent* foo;
obj = foo.get()
if (obj == null) {
    foo.put(...);
}

This is not thread safe. One thread could preempt after the obj == null and then a second thread could come through and do the put. The first thread would then resume and also do the put.

It appears this library needs to be gone through class by class to address thread safety. This is a serious issue that needs to be addressed ASAP if this library is to be used for projects that are highly concurrent. Trading apps come to mind (lots and lots of quotes coming in).

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant