harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nikolay Kuznetsov (JIRA)" <j...@apache.org>
Subject [jira] Commented: (HARMONY-2648) [drlvm][threading] Potential race condition in safe-point callback implementation
Date Tue, 12 Dec 2006 18:42:23 GMT
    [ http://issues.apache.org/jira/browse/HARMONY-2648?page=comments#action_12457837 ] 
            
Nikolay Kuznetsov commented on HARMONY-2648:
--------------------------------------------

Weldon added more comments in regards to safepoint_callback implementation:
http://mail-archives.apache.org/mod_mbox/harmony-dev/200612.mbox/ajax/%3c4dd1f3f00612120949m628ce9c3xdcaf578c589f1b45@mail.gmail.com%3e

It would be nice to incorporate those comments into the final patch as well, following  is
the original message from the dev list:
- A question on hythread_resume()
     - Line 318:   " if (thread->safepoint_callback &&
     thread->suspend_request < 2) return"


   - is there ever the situation where "thread->suspend_request == 0 "
        ??
     -
     - is there a race condition in the use of
     "thread->suspend_request" in lines 318, 319, 320?
        - In specific, does it make sense to replace these lines
        of code with something like:



       int current_suspend_request_count;

       while (1) {

           current_suspend_request_count = thread->suspend_request;

if (thread->safepoint_callback && current_suspend_request_count < 2) return;

       int status = apr_atomic_casptr (current_suspend_request_count,
current_suspend_request--, ((apr_uint32_t *)&(thread->suspend_request);

       if(/*original thread->suspend_request*/ status == 1) {  /* thus the
new value has to be zero

           // Notify the thread that it may wake up now

           hysem_post(thread->resume_event);

           TRACE(("TM: resume one thread: %p request count: %d",thread ,
thread->suspend_request));

           thread->state &= ~TM_THREAD_STATE_SUSPENDED;

           break;

> [drlvm][threading] Potential race condition in safe-point callback implementation
> ---------------------------------------------------------------------------------
>
>                 Key: HARMONY-2648
>                 URL: http://issues.apache.org/jira/browse/HARMONY-2648
>             Project: Harmony
>          Issue Type: Bug
>          Components: DRLVM
>         Environment: All
>            Reporter: Evgueni Brevnov
>         Attachments: safe_point_callback.patch
>
>
> Please read the following thread to understand the problem. Attached patch fixes possible
race conditions but one classlib's test starts to fail org.apache.harmony.luni.tests.java.lang.ThreadGroupTest.test_suspend.
So the patch should be improved to handle this test case correctly.
> Thanks
> Evgueni

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message