Discover Refinitiv
MyRefinitiv Refinitiv Perspectives Careers
Created with Sketch.
All APIs Questions & Answers  Register |  Login
Ask a question
  • Questions
  • Tags
  • Badges
  • Unanswered
Search:
  • Home /
  • Elektron /
  • EMA /
avatar image
Question by nm · May 20, 2019 at 03:31 PM · elektronrefinitiv-realtimeelektron-sdkrrtema-apielektron-message-apic++

Is OmmConsumer::unregister a synchronous call?

It looks like call to OmmConsumer::unregister is synchronous. We are moving from RFA where equivalent call to rfa::sessionLayer::MarketDataSubscriber::unsubscribe was asynchronous. Is OmmConsumer::unregister a synchronous call? If yes, is there an asynchronous call for unsubscribe? Thanks.

People who like this

0 Show 0
Comment
10 |1500 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

2 Replies

  • Sort: 
avatar image
REFINITIV
Best Answer
Answer by umer.nalla · May 22, 2019 at 04:49 AM

Hi @nm

I have received confirmation that this is by design that only the dispatching thread can submit message within the callback methods as the dispatching thread acquires the lock when calling the rsslReactorDispatch method.

The lock is needed to streamline the locking flow between the EMA and the Reactor layers as the Reactor has its own locking as well.

RFA works because it does not use the Reactor and it uses its own message queue to dispatch events from RFA.

So, in answer to your other question there is no 'asynchronous call' - i.e. none that does not use the lock for unsubscribing individual streams.

Comment

People who like this

0 Show 0 · Share
10 |1500 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

avatar image
REFINITIV
Answer by umer.nalla · May 21, 2019 at 06:27 AM

Hi @nm,

Can you expand on what behaviour of RFA MarketDataSubscriber you are trying to recreate with EMA or what EMA behavior suggests synchronous behaviour?

When you call OmmConsumer::unregister for a particular items handle, it relinquishes interest in an open item stream of that item. EMA will unsubscribe that item from the server.

Comment

People who like this

0 Show 1 · Share
10 |1500 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

avatar image
nm · May 21, 2019 at 08:22 AM 0
Share

It seems synchronous because if a call back like onUpdateMsg is in progress and we call unregister from another thread for that item, the unregister is not going to return until the the onUpdateMsg is done. The unregister is waiting for a lock inside EMA

https://github.com/Refinitiv/Elektron-SDK/blob/master/Cpp-C/Ema/Src/Access/Impl/OmmBaseImpl.cpp#L1906-L1908

The lock is hold by the callback https://github.com/Refinitiv/Elektron-SDK/blob/master/Cpp-C/Ema/Src/Access/Impl/OmmBaseImpl.cpp#L1556-L1557

The code we are converting from RFA to EMA uses a lock in the onUpdateMsg. The same lock is hold by the thread that is calling the unregister method. This is getting deadlocked in EMA but does not deadlock in RFA. So in RFA we can call unregister even though a callback is in progress (waiting for a lock which is currently hold by the thread calling unregister).

Watch this question

Add to watch list
Add to your watch list to receive emailed updates for this question. Too many emails? Change your settings >
9 People are following this question.

Related Questions

Refinitive Realtme SDK 2.0.0 C++ contains only eta binaries, is there any plan to release same version for ema library?

EMA C++ forward logging to application so that we can log it ourselves using our own logger

EMA - retry frequency and maximum times controls

fatal error RC1015: cannot open include file 'afxres.h'

The relationship between consumer channels and consumer events

  • Copyright
  • Cookie Policy
  • Privacy Statement
  • Terms of Use
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Alpha
  • App Studio
  • Block Chain
  • Bot Platform
  • Connected Risk APIs
  • DSS
  • Data Fusion
  • Data Model Discovery
  • Datastream
  • Eikon COM
  • Eikon Data APIs
  • Electronic Trading
    • Generic FIX
    • Local Bank Node API
    • Trading API
  • Elektron
    • EMA
    • ETA
    • WebSocket API
  • FX Venues
    • FX Trading – RFQ Maker
  • Intelligent Tagging
  • Legal One
  • Messenger Bot
  • Messenger Side by Side
  • ONESOURCE
    • Indirect Tax
  • Open Calais
  • Open PermID
    • Entity Search
  • Org ID
  • PAM
    • PAM - Logging
  • ProView
  • ProView Internal
  • Product Insight
  • Project Tracking
  • RDMS
  • Refinitiv Data Platform
    • Refinitiv Data Platform Libraries
  • Rose's Space
  • Screening
    • Qual-ID API
    • Screening Deployed
    • Screening Online
    • World-Check One
    • World-Check One Zero Footprint
  • Side by Side Integration API
  • TR Knowledge Graph
  • TREP APIs
    • CAT
    • DACS Station
    • Open DACS
    • RFA
    • UPA
  • TREP Infrastructure
  • TRKD
  • TRTH
  • Thomson One Smart
  • Transactions
    • REDI API
  • Velocity Analytics
  • Wealth Management Web Services
  • Workspace SDK
    • Element Framework
    • Grid
  • World-Check Data File
  • Yield Book Analytics
  • 中文论坛
  • Explore
  • Tags
  • Questions
  • Badges