groovy-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jochen Theodorou (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (GROOVY-7811) Block frequently occurs Groovy multithreading capabilities of mixin
Date Wed, 06 Apr 2016 17:49:25 GMT

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

Jochen Theodorou commented on GROOVY-7811:
------------------------------------------

and here my corrected code:{code:Java}
import java.util.concurrent.*

    ExecutorService service = Executors.newFixedThreadPool(100)

    while (true) {
        service.submit(new Runnable() {
            @Override
            void run() {
                invoke()
            }
        })

    }

static void invoke() {
    User user = new User()
    long start = System.nanoTime()
    user.metaClass.mixin(Man)
    println("spend" + (System.nanoTime() - start))
}

class User {}
class Man {}
{code}
I am not getting a deadlock, but sometimes there are longer times of blocking. But is that
really unexpected? The program does an endless amount of meta class changes, each change is
accompanied by a stop-the-world synchronization. It is not surprising to me at least

> Block frequently occurs Groovy multithreading capabilities of mixin
> -------------------------------------------------------------------
>
>                 Key: GROOVY-7811
>                 URL: https://issues.apache.org/jira/browse/GROOVY-7811
>             Project: Groovy
>          Issue Type: Bug
>    Affects Versions: 2.4.6
>            Reporter: 刘新宇
>            Priority: Blocker
>
> Groovy:2.4.6
> please see : http://stackoverflow.com/questions/36419161/block-frequently-occurs-groovy-multithreading-capabilities-of-mixin#comment60481097_36419161



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

Mime
View raw message