ports/java/jdk15/files/patch-vm::os_bsd.cpp
Greg Lewis 260ffa12c0 . Default UseThreadPriorities to false on BSD. This can be toggled by
passing -XX:+UseThreadPriorities.
. Remove the os_sleep hack which was used on FreeBSD to make sure lower
  priority threads got time slices.  Instead, just call pthread_yield().
  On FreeBSD 7.x with libthr, this will still give lower priority threads
  some time (with the above flag turned on), although such behaviour is
  not guaranteed by POSIX.  This boosts FreeBSD performance by 7-fold on
  an 8 core system, putting it on a par with Solaris (benchmarks by kris@).

  The Java standard and the JCK tests are somewhat contradictory on thread
  priority being guaranteed to work, and in this case the performance
  benefits appear to outweigh any possible side effects.
. Pick up DEFAULT_LD_LIBRARY_PATH from the build environment rather than
  patching it into a file at build time.  This simplifies the Makefile.

Submitted by:	Kurt Miller <kurt@intricatesoftware.com>
2007-09-20 03:35:30 +00:00

33 lines
922 B
C++

$FreeBSD$
--- ../../hotspot/src/os/bsd/vm/os_bsd.cpp.orig Mon Sep 17 21:03:04 2007
+++ ../../hotspot/src/os/bsd/vm/os_bsd.cpp Tue Sep 18 21:36:51 2007
@@ -2271,13 +2271,7 @@
if (thread->is_Java_thread()) {
ThreadBlockInVM tbivm((JavaThread*) thread);
-// BSDXXX: Only use pthread_yield here and below if the system thread
-// scheduler gives time slices to lower priority threads when yielding.
-#ifdef __FreeBSD__
- os_sleep(MinSleepInterval, interruptible);
-#else
pthread_yield();
-#endif
#if SOLARIS
// XXX - This code was not exercised during the Merlin RC1
@@ -2297,13 +2291,7 @@
return 0;
}
-// BSDXXX: Only use pthread_yield here and above if the system thread
-// scheduler gives time slices to lower priority threads when yielding.
-#ifdef __FreeBSD__
- os_sleep(MinSleepInterval, interruptible);
-#else
pthread_yield();
-#endif
return 0;
}