[Ace-users] [ciao-users] DomainApplicationManager_AMI_Impl + Race Condition?
jwillemsen at remedy.nl
Wed Oct 24 13:02:25 CDT 2007
Thanks for using the PRF form. I agree with your comments, can you make the
"Sowayan, Abdullah (N-DUA)" <abdullah.sowayan at lmco.com> wrote in message
news:<mailman.2637.1193244787.5286.ciao-users at mail.cse.wustl.edu>...
> CIAO VERSION: 0.6.1 (SVN HEAD Also)
> In the following file:
> class DomainApplicationManager_Export DomainApplicationManager_AMI_Impl
> : public DomainApplicationManager_AMH_Impl
> /// AMI reply count
> volatile int start_launch_reply_count_;
> Why is the counter volatile? Is this an attempt to eliminate race
> conditions when the variable is accessed concurrentl? If so, the I'd
> have to note that volatile doesn't protect aginst concurrent access, we
> should use ACE_Atomic_Op<ACE_Thread_Mutex, long> instead (on certain
> platforms, this construct does not incur the price of a mutex lock,
> because it expands to assembly code with automic instructions).
> These following method implementations (found in the CPP file) use the
> counter variable. They should be placed in an inline file (*.inl)
> because that's to convention we use in the distribution for non-virtual
> methods that only have 1-3 lines of code.
> decrease_start_launch_reply_count ()
> --this ->start_launch_reply_count_;
> start_launch_reply_count ()
> return this->start_launch_reply_count_;
More information about the Ace-users