I've been having a strange problem with my computer. Here's a java example.
Code:
1 public class Threads {
2 public static void main(String[] args) {
3 int myInt = 0;
4 while (true) {
5 try {
6 Thread.sleep(1);
7 myInt++;
8 System.out.println(myInt);
9 } catch (InterruptedException e) {
10 System.out.println("ERROR");
11 }
12 }
13 }
14 }
This should sleep for 1 milisecond and then continue, but in actuality it sleeps a lot longer than that. It does sleep and then continue, but it doesn't do it correctly. This program will spit out about 70 numbers in 10 seconds on my computer when there are plenty of free resources. The strange thing is that when there *aren't* free resources, it goes a lot faster. By running 'yes 1' in one terminal and then running that java program in another it will put out about 1300 numbers in 10 seconds.
I think this might have something to do with the kernel, but I'm not sure. When I tryed running a different kernel (2.6.11-hardended (selinux)) it ran faster but still improved when i used up resources.
I'm pretty sure it's not a java problem becuase I't s clean install and it does it in some other programs as well (written in C I believe)
Here's some information about my computer
It's a Dell M70 notebook
Pentium-M 2.0 Ghz.
Linux kernel 2.6.13, with libata-dev patch (it's a sata drive) and software suspend2 patch. but like i said, it also did simmilar stuff on a 2.6.11 hardened without patches.
I'm running gentoo 2005.1 with all the recent updates. It's "~x86" so that might be causing some of it.
spenceal-2# lspci
0000:00:00.0 Host bridge: Intel Corporation Mobile 915GM/PM/GMS/910GML Express Processor to DRAM Controller (rev 03)
0000:00:01.0 PCI bridge: Intel Corporation Mobile 915GM/PM Express PCI Express Root Port (rev 03)
0000:00:1c.0 PCI bridge: Intel Corporation 82801FB/FBM/FR/FW/FRW (ICH6 Family) PCI Express Port 1 (rev 03)
0000:00:1d.0 USB Controller: Intel Corporation 82801FB/FBM/FR/FW/FRW (ICH6 Family) USB UHCI #1 (rev 03)
0000:00:1d.1 USB Controller: Intel Corporation 82801FB/FBM/FR/FW/FRW (ICH6 Family) USB UHCI #2 (rev 03)
0000:00:1d.2 USB Excerpts From The First Annual Nerd BowlController: Intel Corporation 82801FB/FBM/FR/FW/FRW (ICH6 Family) USB UHCI #3 (rev 03)
0000:00:1d.3 USB Controller: Intel Corporation 82801FB/FBM/FR/FW/FRW (ICH6 Family) USB UHCI #4 (rev 03)
0000:00:1d.7 USB Controller: Intel Corporation 82801FB/FBM/FR/FW/FRW (ICH6 Family) USB2 EHCI Controller (rev 03)
0000:00:1e.0 PCI bridge: Intel Corporation 82801 Mobile PCI Bridge (rev d3)
0000:00:1e.2 Multimedia audio controller: Intel Corporation 82801FB/FBM/FR/FW/FRW (ICH6 Family) AC'97 Audio Controller (rev 03)
0000:00:1e.3 Modem: Intel Corporation 82801FB/FBM/FR/FW/FRW (ICH6 Family) AC'97 Modem Controller (rev 03)
0000:00:1f.0 ISA bridge: Intel Corporation 82801FBM (ICH6M) LPC Interface Bridge (rev 03)
0000:00:1f.2 IDE interface: Intel Corporation 82801FBM (ICH6M) SATA Controller (rev 03)
0000:00:1f.3 SMBus: Intel Corporation 82801FB/FBM/FR/FW/FRW (ICH6 Family) SMBus Controller (rev 03)
0000:01:00.0 VGA compatible controller: nVidia Corporation NV41 [Quadro FX Go1400] (rev a2)
0000:02:00.0 Ethernet controller: Broadcom Corporation NetXtreme BCM5751 Gigabit Ethernet PCI Express (rev 01)
0000:03:01.0 CardBus bridge: Texas Instruments PCI6515 Cardbus Controller
0000:03:01.5 Communication controller: Texas Instruments PCI6515 SmartCard Controller
0000:03:03.0 Network controller: Broadcom Corporation BCM4309 802.11a/b/g (rev 03)
Let me know if any other information would be helpfull.