bug-kawa
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug-kawa] [bugs #8817] Race condition in ClassType.java and cxr.java


From: Per Bothner
Subject: [Bug-kawa] [bugs #8817] Race condition in ClassType.java and cxr.java
Date: Thu, 06 May 2004 01:04:39 -0400
User-agent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.6) Gecko/20040113

This mail is an automated notification from the bugs tracker
 of the project: Kawa.

/**************************************************************************/
[bugs #8817] Latest Modifications:

Changes by: 
                Per Bothner <address@hidden>
'Date: 
                Thu 05/06/04 at 05:04 (GMT)

------------------ Additional Follow-up Comments ----------------------------
For addMethods, I'd make that synchronized, and add an extra
  if ((flags & ADD_METHODS_DONE) != 0)  return;
We need to do the same for addFields.
One caveat: is this prey to the warnings about "double-locking" and does tha 
matter in practice?

For cxr.java, I don't think we need locking.  Just replace the mask and count 
variables in the program method by local variables, and then set mask and then 
finally count at the end.






/**************************************************************************/
[bugs #8817] Full Item Snapshot:

URL: <http://savannah.gnu.org/bugs/?func=detailitem&item_id=8817>
Project: Kawa
Submitted by: Chris Dean
On: Thu 05/06/04 at 04:08

Category:  Scheme language
Severity:  5 - Average
Item Group:  Run-time exception
Resolution:  None
Assigned to:  None
Status:  Open


Summary:  Race condition in ClassType.java and cxr.java

Original Submission:  There are two race conditions that I'm seeing when 
running under heavy multi-threaded scenarios.

In ClassType.java we have a few test/set blocks that need a syncronized block 
around them.  For example:
  public Method getDeclaredMethods()
  {
    if ((flags & (ADD_METHODS_DONE|EXISTING_CLASS)) == EXISTING_CLASS)
      addMethods(getReflectClass());
    return methods;
  }

A similar situation exists in cxr.java:
 public Object apply1 (Object arg1)
  {
    if (count == 0)
      program(getName().toString());
   ...

I can provide patches if you'de like.

Follow-up Comments
------------------


-------------------------------------------------------
Date: Thu 05/06/04 at 05:04         By: bothner
For addMethods, I'd make that synchronized, and add an extra
  if ((flags & ADD_METHODS_DONE) != 0)  return;
We need to do the same for addFields.
One caveat: is this prey to the warnings about "double-locking" and does tha 
matter in practice?

For cxr.java, I don't think we need locking.  Just replace the mask and count 
variables in the program method by local variables, and then set mask and then 
finally count at the end.












For detailed info, follow this link:
<http://savannah.gnu.org/bugs/?func=detailitem&item_id=8817>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/







reply via email to

[Prev in Thread] Current Thread [Next in Thread]