Need to share common data

118 views
Skip to first unread message

Manjusha Muralidharan

unread,
Jan 24, 2015, 3:59:49 AM1/24/15
to mechanica...@googlegroups.com
Hi,

Let me put one example and try to explain my problem.

I need to share data among the events. Example

There is batch which has 10 transactions, each transaction i treat as an event. I need to collect the number transactions failed, passed and total while processing each event.

one way to do it is use a common cache and update the counter in the cace

is there any better by which i can handle this.

Thanks in advance

Greg Young

unread,
Jan 24, 2015, 7:15:25 AM1/24/15
to mechanica...@googlegroups.com
Well it being you are using addition you can do quite a bit.

Using a common cache will end up with contention on your cache if you have n threads. Why not do a cache per thread and only lock etc when you get the information thus there is no contention on the write but only on the read for aggregated information (I am assuming you do many more writes than reads here).

In general though this might really be premature optimization depending on your workloads.nhave you benchmarked any of this?

Greg
--
You received this message because you are subscribed to the Google Groups "mechanical-sympathy" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mechanical-symp...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


--
Studying for the Turing test

Manjusha Muralidharan

unread,
Jan 24, 2015, 7:47:04 AM1/24/15
to mechanica...@googlegroups.com
Hi Greg,

Thanks for the reply.

Is there a way other than cache to accumulate information through LMAX api's, i mean does it give a handle to observe the events and get suck data from the processed event.

I mean some call back mechanism once the event is processed?

To unsubscribe from this group and stop receiving emails from it, send an email to mechanical-sympathy+unsub...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages