User account creation filtered due to spam.

Bug 7587 - direct threaded interpreter not thread-safe
Summary: direct threaded interpreter not thread-safe
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: libgcj (show other bugs)
Version: 3.3
: P3 normal
Target Milestone: 3.4.2
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-08-13 09:46 UTC by Tom Tromey
Modified: 2004-07-14 00:25 UTC (History)
3 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2004-05-21 03:46:58


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tom Tromey 2002-08-13 09:46:00 UTC
The direct-threaded interpreter doesn't lock
when testing or assigning `prepared'.
This isn't thread-safe.

Release:
unknown
Comment 1 Tom Tromey 2002-08-13 16:12:12 UTC
From: Tom Tromey <tromey@redhat.com>
To: gcc-gnats@gcc.gnu.org
Cc:  
Subject: Re: libgcj/7587: direct threaded interpreter not thread-safe
Date: 13 Aug 2002 16:12:12 -0600

 Tom> The direct-threaded interpreter doesn't lock
 Tom> when testing or assigning `prepared'.
 Tom> This isn't thread-safe.
 
 This problem occurs in many places in the direct-threaded code :-(
 In particular it happens whenever we rewrite the compiled bytecode.
 
 Tom
Comment 2 Andrew Pinski 2003-05-24 19:39:07 UTC
Trust Tom on this one.
Comment 3 CVS Commits 2004-07-13 21:03:08 UTC
Subject: Bug 7587

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	bryce@gcc.gnu.org	2004-07-13 21:03:03

Modified files:
	libjava        : ChangeLog prims.cc interpret.cc 
	libjava/include: java-interp.h 

Log message:
	2004-07-13  Bryce McKinlay  <mckinlay@redhat.com>
	
	PR libgcj/7587
	* interpret.cc (compile_mutex): New.
	(_Jv_InitInterpreter): New. Initialize compile_mutex.
	(run): Lock compile_mutex before calling compile() if compilation is
	required.
	* prims.cc (_Jv_CreateJavaVM): Call _Jv_InitInterpreter().
	* include/java-interp.h (_Jv_InitInterpreter): Declare.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libjava/ChangeLog.diff?cvsroot=gcc&r1=1.2925&r2=1.2926
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libjava/prims.cc.diff?cvsroot=gcc&r1=1.91&r2=1.92
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libjava/interpret.cc.diff?cvsroot=gcc&r1=1.43&r2=1.44
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libjava/include/java-interp.h.diff?cvsroot=gcc&r1=1.24&r2=1.25

Comment 4 Andrew Pinski 2004-07-14 00:17:18 UTC
Fixed.
Comment 5 CVS Commits 2004-07-14 00:24:12 UTC
Subject: Bug 7587

CVSROOT:	/cvs/gcc
Module name:	gcc
Branch: 	gcc-3_4-branch
Changes by:	bryce@gcc.gnu.org	2004-07-14 00:24:06

Modified files:
	libjava        : ChangeLog interpret.cc prims.cc 
	libjava/include: java-interp.h jvm.h 

Log message:
	2004-07-13  Bryce McKinlay  <mckinlay@redhat.com>
	
	PR libgcj/7587
	* interpret.cc (compile_mutex): New.
	(_Jv_InitInterpreter): New. Initialize compile_mutex.
	(run): Lock compile_mutex before calling compile() if compilation is
	required.
	* prims.cc (_Jv_CreateJavaVM): Call _Jv_InitInterpreter().
	* include/java-interp.h (_Jv_InitInterpreter): Declare.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libjava/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.2562.2.22&r2=1.2562.2.23
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libjava/interpret.cc.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.40&r2=1.40.10.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libjava/prims.cc.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.87.2.1&r2=1.87.2.2
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libjava/include/java-interp.h.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.23&r2=1.23.8.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libjava/include/jvm.h.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.62&r2=1.62.8.1