You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Pavel Pervov (JIRA)" <ji...@apache.org> on 2008/05/04 11:16:55 UTC

[jira] Created: (HARMONY-5801) [drlvm][thread][regression] Thread.yield intermittently does not work.

[drlvm][thread][regression] Thread.yield intermittently does not work.
----------------------------------------------------------------------

                 Key: HARMONY-5801
                 URL: https://issues.apache.org/jira/browse/HARMONY-5801
             Project: Harmony
          Issue Type: Bug
          Components: DRLVM
         Environment: Linux
            Reporter: Pavel Pervov


The following test recently started to fail intermittently on DRLVM:

class yield {
    int tPass = 0;

    class T extends Thread {
        public void run() {
            tPass++;
        }
    }

    void test() {
        T t = new T();
        int numYields = 2000;
        try {
            t.setPriority(Thread.MAX_PRIORITY);
            t.start();
        } catch(Throwable e) {
            System.out.println("Exception: " + e);
        }

        while(numYields > 0 && tPass == 0) {
            numYields--;
            Thread.currentThread().yield();
        }

        if(tPass == 0) {
            System.out.println("FAILED");
        } else {
            System.out.println("PASSED");
        }
    }

    public static void main(String[] args) {
        new yield().test();
    }
}

The test passes stably on RI.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HARMONY-5801) [drlvm][thread][regression] Thread.yield intermittently does not work.

Posted by "Ilya Berezhniuk (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HARMONY-5801?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12596093#action_12596093 ] 

Ilya Berezhniuk commented on HARMONY-5801:
------------------------------------------

Probably a cause of the problem is in using new APR version, because hythread_yield() simply re-calls apr_thread_yield().

One of probable solutions is implementing our own port_thread_yield() in DRLVM's Portlib; or even made these functions inlined from Portlib's header because they simply re-invoke API functions (probably with argument checking).
I'll try to reproduce the failure and check if this fixes a problem.


> [drlvm][thread][regression] Thread.yield intermittently does not work.
> ----------------------------------------------------------------------
>
>                 Key: HARMONY-5801
>                 URL: https://issues.apache.org/jira/browse/HARMONY-5801
>             Project: Harmony
>          Issue Type: Bug
>          Components: DRLVM
>         Environment: Linux
>            Reporter: Pavel Pervov
>
> The following test recently started to fail intermittently on DRLVM:
> class yield {
>     int tPass = 0;
>     class T extends Thread {
>         public void run() {
>             tPass++;
>         }
>     }
>     void test() {
>         T t = new T();
>         int numYields = 2000;
>         try {
>             t.setPriority(Thread.MAX_PRIORITY);
>             t.start();
>         } catch(Throwable e) {
>             System.out.println("Exception: " + e);
>         }
>         while(numYields > 0 && tPass == 0) {
>             numYields--;
>             Thread.currentThread().yield();
>         }
>         if(tPass == 0) {
>             System.out.println("FAILED");
>         } else {
>             System.out.println("PASSED");
>         }
>     }
>     public static void main(String[] args) {
>         new yield().test();
>     }
> }
> The test passes stably on RI.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (HARMONY-5801) [drlvm][thread][regression] Thread.yield intermittently does not work.

Posted by "Pavel Pervov (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-5801?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Pavel Pervov resolved HARMONY-5801.
-----------------------------------

    Resolution: Cannot Reproduce

Looking at the testing results I can't see this failure anymore. Closing as cannot reproduce for now.

> [drlvm][thread][regression] Thread.yield intermittently does not work.
> ----------------------------------------------------------------------
>
>                 Key: HARMONY-5801
>                 URL: https://issues.apache.org/jira/browse/HARMONY-5801
>             Project: Harmony
>          Issue Type: Bug
>          Components: DRLVM
>         Environment: Linux
>            Reporter: Pavel Pervov
>
> The following test recently started to fail intermittently on DRLVM:
> class yield {
>     int tPass = 0;
>     class T extends Thread {
>         public void run() {
>             tPass++;
>         }
>     }
>     void test() {
>         T t = new T();
>         int numYields = 2000;
>         try {
>             t.setPriority(Thread.MAX_PRIORITY);
>             t.start();
>         } catch(Throwable e) {
>             System.out.println("Exception: " + e);
>         }
>         while(numYields > 0 && tPass == 0) {
>             numYields--;
>             Thread.currentThread().yield();
>         }
>         if(tPass == 0) {
>             System.out.println("FAILED");
>         } else {
>             System.out.println("PASSED");
>         }
>     }
>     public static void main(String[] args) {
>         new yield().test();
>     }
> }
> The test passes stably on RI.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HARMONY-5801) [drlvm][thread][regression] Thread.yield intermittently does not work.

Posted by "Ilya Berezhniuk (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HARMONY-5801?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12596310#action_12596310 ] 

Ilya Berezhniuk commented on HARMONY-5801:
------------------------------------------

I still cannot reproduce the bug at all.
I checked the test on Linux x86 and x86_64, it does not fail on ~1000 tries for both debug and release on SuSE.

Pavel, could you help with reproducing?
What platform should I use?

> [drlvm][thread][regression] Thread.yield intermittently does not work.
> ----------------------------------------------------------------------
>
>                 Key: HARMONY-5801
>                 URL: https://issues.apache.org/jira/browse/HARMONY-5801
>             Project: Harmony
>          Issue Type: Bug
>          Components: DRLVM
>         Environment: Linux
>            Reporter: Pavel Pervov
>
> The following test recently started to fail intermittently on DRLVM:
> class yield {
>     int tPass = 0;
>     class T extends Thread {
>         public void run() {
>             tPass++;
>         }
>     }
>     void test() {
>         T t = new T();
>         int numYields = 2000;
>         try {
>             t.setPriority(Thread.MAX_PRIORITY);
>             t.start();
>         } catch(Throwable e) {
>             System.out.println("Exception: " + e);
>         }
>         while(numYields > 0 && tPass == 0) {
>             numYields--;
>             Thread.currentThread().yield();
>         }
>         if(tPass == 0) {
>             System.out.println("FAILED");
>         } else {
>             System.out.println("PASSED");
>         }
>     }
>     public static void main(String[] args) {
>         new yield().test();
>     }
> }
> The test passes stably on RI.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Closed: (HARMONY-5801) [drlvm][thread][regression] Thread.yield intermittently does not work.

Posted by "Pavel Pervov (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-5801?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Pavel Pervov closed HARMONY-5801.
---------------------------------


> [drlvm][thread][regression] Thread.yield intermittently does not work.
> ----------------------------------------------------------------------
>
>                 Key: HARMONY-5801
>                 URL: https://issues.apache.org/jira/browse/HARMONY-5801
>             Project: Harmony
>          Issue Type: Bug
>          Components: DRLVM
>         Environment: Linux
>            Reporter: Pavel Pervov
>
> The following test recently started to fail intermittently on DRLVM:
> class yield {
>     int tPass = 0;
>     class T extends Thread {
>         public void run() {
>             tPass++;
>         }
>     }
>     void test() {
>         T t = new T();
>         int numYields = 2000;
>         try {
>             t.setPriority(Thread.MAX_PRIORITY);
>             t.start();
>         } catch(Throwable e) {
>             System.out.println("Exception: " + e);
>         }
>         while(numYields > 0 && tPass == 0) {
>             numYields--;
>             Thread.currentThread().yield();
>         }
>         if(tPass == 0) {
>             System.out.println("FAILED");
>         } else {
>             System.out.println("PASSED");
>         }
>     }
>     public static void main(String[] args) {
>         new yield().test();
>     }
> }
> The test passes stably on RI.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HARMONY-5801) [drlvm][thread][regression] Thread.yield intermittently does not work.

Posted by "Nathan Beyer (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HARMONY-5801?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12596225#action_12596225 ] 

Nathan Beyer commented on HARMONY-5801:
---------------------------------------

Did the thread yielding code in APR change between the version it was previously to the version it is now? I performed a diff on the APR changes in the two versions and there were very few. Additionally, it should be noted that the APR upgrade wasn't just a library upgrade, there were custom patches that were being applied that were removed, though as I recall, those were for windows.

> [drlvm][thread][regression] Thread.yield intermittently does not work.
> ----------------------------------------------------------------------
>
>                 Key: HARMONY-5801
>                 URL: https://issues.apache.org/jira/browse/HARMONY-5801
>             Project: Harmony
>          Issue Type: Bug
>          Components: DRLVM
>         Environment: Linux
>            Reporter: Pavel Pervov
>
> The following test recently started to fail intermittently on DRLVM:
> class yield {
>     int tPass = 0;
>     class T extends Thread {
>         public void run() {
>             tPass++;
>         }
>     }
>     void test() {
>         T t = new T();
>         int numYields = 2000;
>         try {
>             t.setPriority(Thread.MAX_PRIORITY);
>             t.start();
>         } catch(Throwable e) {
>             System.out.println("Exception: " + e);
>         }
>         while(numYields > 0 && tPass == 0) {
>             numYields--;
>             Thread.currentThread().yield();
>         }
>         if(tPass == 0) {
>             System.out.println("FAILED");
>         } else {
>             System.out.println("PASSED");
>         }
>     }
>     public static void main(String[] args) {
>         new yield().test();
>     }
> }
> The test passes stably on RI.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.