[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Bug-kawa] [bug #14098] runnable rfe
From: |
tk |
Subject: |
[Bug-kawa] [bug #14098] runnable rfe |
Date: |
Fri, 12 Aug 2005 15:44:59 +0000 |
User-agent: |
Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en) AppleWebKit/412.6 (KHTML, like Gecko) Safari/412.2 |
Follow-up Comment #2, bug #14098 (project kawa):
Thanks for taking a look at this. I wasn't happy about the code
duplication either, but there are problems with your version.
The additional space overhead of using Thread is about a dozen
private fields, and the Thread constructor adds the instance to
the current ThreadGroup. This overhead may be small compared with
the creation of the RunnableClosure, but it's more than nothing.
There's also a more serious problem. While the thread stack isn't
created until start is called, in version 1.4 JVMs (at least) the
thread isn't removed from its ThreadGroup until the thread exits,
which it can't do without being started, so you're left with a
choice of leaking memory or having to allocate the stack and
scheduling the thread before it can be reclaimed. (I haven't
checked on whether 1.5 JVMs continue this hapless approach).
I'll look at whether there's another way to refactor it; if not I'd say
a little code duplication is worth avoiding the foregoing silliness.
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?func=detailitem&item_id=14098>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/
- [Bug-kawa] [bug #14098] runnable rfe, tk, 2005/08/11
- [Bug-kawa] [bug #14098] runnable rfe, Per Bothner, 2005/08/12
- [Bug-kawa] [bug #14098] runnable rfe,
tk <=
- [Bug-kawa] [bug #14098] runnable rfe, Per Bothner, 2005/08/15
- [Bug-kawa] [bug #14098] runnable rfe, tk, 2005/08/15
- [Bug-kawa] [bug #14098] runnable rfe, tk, 2005/08/15
- [Bug-kawa] [bug #14098] runnable rfe, Per Bothner, 2005/08/24
- [Bug-kawa] Re: [bug #14098] runnable rfe, thomas kirk, 2005/08/25