[QFJ-135] session -> setResponder not thread safe Created: 07/Feb/07  Updated: 11/Feb/09  Resolved: 15/Feb/07

Status: Closed
Project: QuickFIX/J
Component/s: Engine
Affects Version/s: 1.0.5
Fix Version/s: 1.0.5

Type: Bug Priority: Minor
Reporter: Christopher Hurst Assignee: Steve Bate
Resolution: Fixed Votes: 0
Labels: None
Environment:

Windows / Unix



 Description   

setResponder is not synchronized (responder not volatile) and called from a different thread to hasResponder.

Although hasResponder is synchronized and will get the latest version from main memory dropping its thread cache , there is no obvious guarantee that the thread calling setResponder has hit a memory barrier and forced its new responder value to main memory so hasResponder method can return an unexpected result as it will get the latest one from memory but not from the other threads cache that may not have been pushed to main memory yet.

change setResponder to be synchronized.

public synchronized void setResponder(Responder responder)


Generated at Sat May 18 23:47:25 UTC 2024 using JIRA 7.5.2#75007-sha1:9f5725bb824792b3230a5d8716f0c13e296a3cae.