Overclock.net › Forums › Software, Programming and Coding › Coding and Programming › java multithreading app port
New Posts  All Forums:Forum Nav:

java multithreading app port

post #1 of 3
Thread Starter 
i have an assignment that i need to use something that was not covered in my syllabus and i chose to use a tic tac toe game and port it to multithreading. does anyone know of any good sites taht explain how the programming works?
Prebuilt rig
(13 items)
 
  
CPUMotherboardGraphicsRAM
core 2 quad q9550 asus p5n-d  GTX 550 TI 8gb corsair xms2 2x4gb pairs 
Hard DriveOptical DriveOSMonitor
500gb sata drive & 2tb sata2 drive cd/dvd + cd/dvd burner windows vista ultimate 64bit aces x193w 
KeyboardPowerCaseMouse
microsoft keyboard 850 watts xigmatex modular psu cool master logitech optical 
  hide details  
Reply
Prebuilt rig
(13 items)
 
  
CPUMotherboardGraphicsRAM
core 2 quad q9550 asus p5n-d  GTX 550 TI 8gb corsair xms2 2x4gb pairs 
Hard DriveOptical DriveOSMonitor
500gb sata drive & 2tb sata2 drive cd/dvd + cd/dvd burner windows vista ultimate 64bit aces x193w 
KeyboardPowerCaseMouse
microsoft keyboard 850 watts xigmatex modular psu cool master logitech optical 
  hide details  
Reply
post #2 of 3
Start by reading the API. Here's the JavaDoc page for the Thread class in JDK 1.6:

http://java.sun.com/javase/6/docs/ap...ng/Thread.html

This article goes into greater detail:

http://www.deitel.com/articles/java_...ial_Part1.html

I suggest you write just a basic test of multithreading, just to ensure you understand how it works, before going writing your actual code.

What exactly do you plan to use multiple threads for? Threads help you deal with concurrency issues: multiple tasks running at the same time. By separating code into threads, you can isolate your thinking for each task from one another. Threads are an example of decoupling, which is a good thing; the less any given piece of code needs to know, the easier that code is to change later.

I can't really see how Tic-Tac-Toe lends itself to multithreading, though. Plan it out. The main thread will bootstap your application (main), and what will the second thread do?

There are some common pitfalls in programming with threads, some of which are described here:

http://jdj.sys-con.com/read/36681.htm
    
CPUGraphicsRAMHard Drive
Intel 2.4 Core i7 AMD Radeon HD 6750M 8 GB 1067 MHz DDR3 750 GB 
OS
Mac OS-X Lion 
  hide details  
Reply
    
CPUGraphicsRAMHard Drive
Intel 2.4 Core i7 AMD Radeon HD 6750M 8 GB 1067 MHz DDR3 750 GB 
OS
Mac OS-X Lion 
  hide details  
Reply
post #3 of 3
Thread Starter 
Quote:
Originally Posted by Scriptorum View Post
Start by reading the API. Here's the JavaDoc page for the Thread class in JDK 1.6:

http://java.sun.com/javase/6/docs/ap...ng/Thread.html

This article goes into greater detail:

http://www.deitel.com/articles/java_...ial_Part1.html

I suggest you write just a basic test of multithreading, just to ensure you understand how it works, before going writing your actual code.

What exactly do you plan to use multiple threads for? Threads help you deal with concurrency issues: multiple tasks running at the same time. By separating code into threads, you can isolate your thinking for each task from one another. Threads are an example of decoupling, which is a good thing; the less any given piece of code needs to know, the easier that code is to change later.

I can't really see how Tic-Tac-Toe lends itself to multithreading, though. Plan it out. The main thread will bootstap your application (main), and what will the second thread do?

There are some common pitfalls in programming with threads, some of which are described here:

http://jdj.sys-con.com/read/36681.htm
this is for an assignment where we have to take code form internet or book, and i did that i found the tic tac toe code. when i tried this on the site that i got the code from i did notice it was a lil sluggish. and with that code i have to modify it to use stuff that was not covered in my syllabus.
Prebuilt rig
(13 items)
 
  
CPUMotherboardGraphicsRAM
core 2 quad q9550 asus p5n-d  GTX 550 TI 8gb corsair xms2 2x4gb pairs 
Hard DriveOptical DriveOSMonitor
500gb sata drive & 2tb sata2 drive cd/dvd + cd/dvd burner windows vista ultimate 64bit aces x193w 
KeyboardPowerCaseMouse
microsoft keyboard 850 watts xigmatex modular psu cool master logitech optical 
  hide details  
Reply
Prebuilt rig
(13 items)
 
  
CPUMotherboardGraphicsRAM
core 2 quad q9550 asus p5n-d  GTX 550 TI 8gb corsair xms2 2x4gb pairs 
Hard DriveOptical DriveOSMonitor
500gb sata drive & 2tb sata2 drive cd/dvd + cd/dvd burner windows vista ultimate 64bit aces x193w 
KeyboardPowerCaseMouse
microsoft keyboard 850 watts xigmatex modular psu cool master logitech optical 
  hide details  
Reply
New Posts  All Forums:Forum Nav:
  Return Home
  Back to Forum: Coding and Programming
Overclock.net › Forums › Software, Programming and Coding › Coding and Programming › java multithreading app port