You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Ilya Berezhniuk (JIRA)" <ji...@apache.org> on 2008/05/12 17:26:55 UTC
[jira] Commented: (HARMONY-5801) [drlvm][thread][regression]
Thread.yield intermittently does not work.
[ 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.