| Author |
Message |
|
MartinSmith
Site Admin
Joined: Mon Oct 12, 2009 3:11 pm Posts: 328 Location: Irvine, CA
|
 Member Project - Multithreading Test
So when I was just starting to experiment with multithreading in Java a wrote a short program to benchmark multi- and single-threaded performance. I wrote the following code rather hastily, but everything seems to work fine. It does take a while to run, but it is fun to see Java making use of every core. The actual multithreading isn't done properly (it just spawns shit-loads of threads regardless of the number of cores you have), but you still get some interesting results. Try it out, experiment with it, and post back any findings.
This is the program we discussed and ran during the club meeting on Monday, October 19th 2009. This version does not have a GUI.
EDIT: updated source here and later on in the thread!
_________________ Website: http://www.intercottageindustries.com Handle: Taenon
Ubuntu/Win7 January 2010: AMD Phenom II x4 955 BE @ 3.6GHz (from 3.2GHz) ASUS 790X Mobo @ 2000MHz HT G.Skill 2x2GiB DDR3 @ 9-9-9-24 1600MHz BFG GTX 260 core 216 896MiB Corsair 750tx 750W PSU
|
| Mon Oct 19, 2009 1:04 pm |
|
 |
|
SirGrant
Joined: Wed Oct 21, 2009 6:28 pm Posts: 34
|
 Re: Member Project - Multithreading Test
Sorry but I kinda get the jist of what you are doing but this could really use comments.
_________________
|
| Fri Feb 26, 2010 12:36 am |
|
 |
|
MartinSmith
Site Admin
Joined: Mon Oct 12, 2009 3:11 pm Posts: 328 Location: Irvine, CA
|
 Re: Member Project - Multithreading Test
I thought it was pretty self-explanatory, but I will comment it anyway. I'm working on adding a few other types of thread management as well.
_________________ Website: http://www.intercottageindustries.com Handle: Taenon
Ubuntu/Win7 January 2010: AMD Phenom II x4 955 BE @ 3.6GHz (from 3.2GHz) ASUS 790X Mobo @ 2000MHz HT G.Skill 2x2GiB DDR3 @ 9-9-9-24 1600MHz BFG GTX 260 core 216 896MiB Corsair 750tx 750W PSU
|
| Fri Feb 26, 2010 1:57 pm |
|
 |
|
SirGrant
Joined: Wed Oct 21, 2009 6:28 pm Posts: 34
|
 Re: Member Project - Multithreading Test
It might be self explanatory. Sorry it's just I am not that advanced (I'm almost done with my first comp sci class) but I'm not that far into the field of CS.
_________________
|
| Tue Mar 02, 2010 3:40 am |
|
 |
|
MartinSmith
Site Admin
Joined: Mon Oct 12, 2009 3:11 pm Posts: 328 Location: Irvine, CA
|
 Re: Member Project - Multithreading Test
Noooo problem. I'm almost done adding functionality, but I'm running into a really strange bug. Maybe I'll make use of the open source model and post it anyway, and see if you guys can help.
_________________ Website: http://www.intercottageindustries.com Handle: Taenon
Ubuntu/Win7 January 2010: AMD Phenom II x4 955 BE @ 3.6GHz (from 3.2GHz) ASUS 790X Mobo @ 2000MHz HT G.Skill 2x2GiB DDR3 @ 9-9-9-24 1600MHz BFG GTX 260 core 216 896MiB Corsair 750tx 750W PSU
|
| Tue Mar 02, 2010 10:00 am |
|
 |
|
MartinSmith
Site Admin
Joined: Mon Oct 12, 2009 3:11 pm Posts: 328 Location: Irvine, CA
|
 Re: Member Project - Multithreading Test
Ok, got it finished, working, and commented. The .tar.gz is attached. Please, look at the code, provide comments and suggestions, and run this on your own computer and post benchmarks! Right now it just computes CPU time and just for the default heap size's amount of memory. It will make use of all logical and physical cores available to it, and depending on where you run it might slow your computer down for a couple seconds. Feel free to increase the number of runs if you want. I want to implement this using OpenCL and CUDA soon as well, and I want your help! I'm thinking of putting it on github to really try to drive this as the club's first group open source project. Not only is it valuable for determining the most efficient multithreading technique for a given problem, it is a great educational tool. Lets do this!
My output:
Working... Average Time For Semaphore Mediated Threading = 0.04775seconds. Sum: 17857072 Average Time For Nested Threading = 0.13132seconds. Sum: 17857072 Average Time CrazyThreaded = 0.04488seconds. Sum: 17857072 Average Time Single Threaded = 0.0505seconds. Sum: 17857072
_________________ Website: http://www.intercottageindustries.com Handle: Taenon
Ubuntu/Win7 January 2010: AMD Phenom II x4 955 BE @ 3.6GHz (from 3.2GHz) ASUS 790X Mobo @ 2000MHz HT G.Skill 2x2GiB DDR3 @ 9-9-9-24 1600MHz BFG GTX 260 core 216 896MiB Corsair 750tx 750W PSU
|
| Thu Mar 04, 2010 11:38 am |
|
 |
|
MartinSmith
Site Admin
Joined: Mon Oct 12, 2009 3:11 pm Posts: 328 Location: Irvine, CA
|
 Re: Member Project - Multithreading Test
The output on the desktop in my sig:
Working... Average Time For Semaphore Mediated Threading = 0.02602seconds. Sum: 17857072 Average Time For Nested Threading = 0.0291seconds. Sum: 17857072 Average Time CrazyThreaded = 0.02529seconds. Sum: 17857072 Average Time Single Threaded = 0.00841seconds. Sum: 17857072
And boom goes the dynamite.
I think I need to work on a better multithreading technique! Or Benchmark. W/e.
_________________ Website: http://www.intercottageindustries.com Handle: Taenon
Ubuntu/Win7 January 2010: AMD Phenom II x4 955 BE @ 3.6GHz (from 3.2GHz) ASUS 790X Mobo @ 2000MHz HT G.Skill 2x2GiB DDR3 @ 9-9-9-24 1600MHz BFG GTX 260 core 216 896MiB Corsair 750tx 750W PSU
|
| Sat Mar 06, 2010 10:42 pm |
|
 |
|
MartinSmith
Site Admin
Joined: Mon Oct 12, 2009 3:11 pm Posts: 328 Location: Irvine, CA
|
 Re: Member Project - Multithreading Test
MSI Wind U100 1.6GHz Atom processor, 2GiB ram:
Working... Average Time For Semaphore Mediated Threading = 0.04919seconds. Sum: 17857072 Average Time For Nested Threading = 0.02534seconds. Sum: 17857072 Average Time CrazyThreaded = 0.04501seconds. Sum: 17857072 Average Time Single Threaded = 0.01471seconds. Sum: 17857072
_________________ Website: http://www.intercottageindustries.com Handle: Taenon
Ubuntu/Win7 January 2010: AMD Phenom II x4 955 BE @ 3.6GHz (from 3.2GHz) ASUS 790X Mobo @ 2000MHz HT G.Skill 2x2GiB DDR3 @ 9-9-9-24 1600MHz BFG GTX 260 core 216 896MiB Corsair 750tx 750W PSU
|
| Mon Mar 08, 2010 12:32 pm |
|
 |
|
MartinSmith
Site Admin
Joined: Mon Oct 12, 2009 3:11 pm Posts: 328 Location: Irvine, CA
|
 Re: Member Project - Multithreading Test
Huh, now the benchmark on the desktop in my sig looks like this:
Working... Average Time For Semaphore Mediated Threading = 0.0089seconds. Sum: 17857072 Average Time For Nested Threading = 0.0053seconds. Sum: 17857072 Average Time CrazyThreaded = 0.00859seconds. Sum: 17857072 Average Time Single Threaded = 0.00827seconds. Sum: 17857072
Only thing that has changed is a fresh install and new HDD. This is on Windows 7, not sure what the difference is.
_________________ Website: http://www.intercottageindustries.com Handle: Taenon
Ubuntu/Win7 January 2010: AMD Phenom II x4 955 BE @ 3.6GHz (from 3.2GHz) ASUS 790X Mobo @ 2000MHz HT G.Skill 2x2GiB DDR3 @ 9-9-9-24 1600MHz BFG GTX 260 core 216 896MiB Corsair 750tx 750W PSU
|
| Tue Mar 30, 2010 11:02 pm |
|
|