This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: [cp-patches] [PATCH] Fix PR classpath/24086, PR classpath/24091, PR classpath/24104 et al. ...


David Daney wrote:
> A finalizer is simple and gets the job done.

Finalizers are anything but simple. They really should only be used to
free native resources (as a last resort), not for any type of Java clean
up. Blocking and locking should be avoided in a finalizer. Typically
there is only one finalizer thread and you don't want to hog that by
blocking on I/O.

I wrote about how finalize should be used on my blog:
http://weblog.ikvm.net/permalink.aspx?guid=3E0ABC11-F486-4366-9127-CF38B
B6C3EF1

Regards,
Jeroen


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]