[jboss-jira] [JBoss JIRA] (DROOLS-578) add double null check to asm stub builders

david hendi (JIRA) issues at jboss.org
Mon Aug 25 21:28:59 EDT 2014


     [ https://issues.jboss.org/browse/DROOLS-578?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

david hendi updated DROOLS-578:
-------------------------------
    Attachment: asm-builder-double-null-check.patch


patch for fixing the blocking issue

> add double null check to asm stub builders
> ------------------------------------------
>
>                 Key: DROOLS-578
>                 URL: https://issues.jboss.org/browse/DROOLS-578
>             Project: Drools
>          Issue Type: Patch
>      Security Level: Public(Everyone can see) 
>    Affects Versions: 6.1.0.Beta1, 6.1.0.Beta2, 6.1.0.Beta3, 6.1.0.Beta4, 6.1.0.CR1, 6.1.0.CR2, 6.1.0.Final
>            Reporter: david hendi
>            Assignee: Mark Proctor
>         Attachments: asm-builder-double-null-check.patch
>
>
> currently the code generated does a null check within the synchronized code. this forces all threads to block while the check is made even after the check returns false. by adding a double null check, the synchronized code is bypassed once the check is satisfied. 
> public void evaluate(KnowledgeHelper paramKnowledgeHelper, WorkingMemory paramWorkingMemory)
>             throws Exception
>     {
>         if (this.consequence == null) {
>             synchronized (this) {
>                 if (this.consequence == null) {
>                     ConsequenceGenerator.generate(this, paramKnowledgeHelper, paramWorkingMemory);
>                 }
>             }
>         }
>         this.consequence.evaluate(paramKnowledgeHelper, paramWorkingMemory);
>     }



--
This message was sent by Atlassian JIRA
(v6.3.1#6329)


More information about the jboss-jira mailing list