[ 
https://issues.apache.org/jira/browse/HBASE-15047?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15074590#comment-15074590
 ] 

Duo Zhang commented on HBASE-15047:
-----------------------------------

OK, I should add a limitation 'in production'. In micro benchmark, yes, it can 
be much faster. But in production environment, as [~stack] said above, thread 
scheduling is not controlled by us so we can hardly tell how long a spin will 
continue thus the spin may waste lots of CPU time.

And see this paper
"Ad Hoc Synchronization Considered Harmful"
https://www.usenix.org/legacy/event/osdi10/tech/full_papers/Xiong.pdf

The key point here is "Ad Hoc Synchronization" is not easy to understand so 
people will easily break your initial assumption and cause a very bad 
performance impact.

Thanks.

> Try spin lock for MVCC completion
> ---------------------------------
>
>                 Key: HBASE-15047
>                 URL: https://issues.apache.org/jira/browse/HBASE-15047
>             Project: HBase
>          Issue Type: Bug
>            Reporter: Elliott Clark
>            Assignee: Elliott Clark
>         Attachments: HBASE-15047.patch
>
>
> Waits/Notify is very very expensive since it can cost a thread scheduling. 
> There should only ever be a few threads ( < Num Cores ) running. So it should 
> be possible to spin and use compare and swap to update the read point.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to