Go Back   Java Programming Forums > Java Standard Edition Programming Help > Threads


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 12-02-2010, 07:22 AM
Junior Member
 

Join Date: Feb 2010
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
sonai4u is on a distinguished road
Default Need Urgent Help

Language/Platform

This project must target a Unix platform and execute properly on our Unix apache server.
The project must be written in C, C++, or Java.
If using C or C++, you must use a Unix fork to create child processes and a Unix pipe for communication.
If using Java, you must use the Runtime exec method to create child processes and use streams for communication.
Any other method requires instructor approval.


Problem Overview

The purpose is to demonstrate a reduction in elapsed time by dividing a problem between two child processes running in parallel versus a single child process. To magnify the difference, a slow O(N^3) algorithm will be used to find the maximum subsequence sum of a list. In this case, a list half as large should take around 1/8 as long to process. So, the approach will be to measure the time using one process working on the entire list, versus two processes each working on half the list and demonstrate the time reduction.

Because the maximum subsequence sum could span across the two lists, the center-spanning sum must also be found by the parent process, but this is done in O(N) time so it will not noticeably affect the overall results.

The user will provide a filename containing data to process and how many processes should be used (1 or 2) as command-line inputs. The program will read the data from the file into a list. The list is then divided among the number of child processes. Each child process will use the maximum subsequence sum algorithm to process its portion and write the result to a separate pipe (or stream in Java). The parent will read from the pipes (streams) to get the results. The parent will then compute the center-spanning sum (in the two-child case) and print the maximum subsequence sum to the screen.



Other Details

The data file will contain integer data, one integer per line. It will be a Unix file, with only a newline at the end of each line. The data file provided is an example. Your program should support files as large as 500 numbers.

The filename and number of child processes to create must be command line arguments where the first argument is the filename and the second argument is the number of processes.

To get the running time, follow the examples posted in eLearning. The elapsed time should exclude the time to read the input file.

The maximum subsequence sum code can be found at: http://users.cis.fiu.edu/~weiss/dsaa...axSumTest.java

Hi,

Can anyone please help me and let me know how i start doing this program.

Please do help me.

thanks a lot in advance.

sonai4u



Reply With Quote Share this thread on Facebook
Sponsored Links
Java Training from DevelopIntelligence
  #2 (permalink)  
Old 12-02-2010, 10:31 AM
Member
 

Join Date: Jan 2010
Location: Oxford, UK
Posts: 30
Thanks: 2
Thanked 7 Times in 7 Posts
Shambolic is on a distinguished road
Default Re: Need Urgent Help

Nobody is going to do your assignment for you. If you try it yourself, and run into specific
problems with parts of your code, we can then help you work out what you're doing wrong.
Reply With Quote
  #3 (permalink)  
Old 14-02-2010, 12:24 AM
Junior Member
 

Join Date: Feb 2010
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
sonai4u is on a distinguished road
Default Re: Need Urgent Help

Hi,

Thanks a lot for your response.

I completely agree with you. I just want anyone to help me start the program and give me some inputs on those.

thats all i'm looking for.

thanks

sonai4u
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



Similar Threads
Thread Thread Starter Forum Replies Last Post
Urgent Doubts shilpareddy553 What's Wrong With My Code? 1 27-03-2010 06:26 AM
JSP E-BOOK URGENT PLEASE YUSUFOZTURK JavaServer Pages: JSP & JSTL 1 01-12-2009 10:58 PM
Urgent Help pb60704 Web Frameworks 7 01-12-2009 07:27 AM
Urgent code needed subhvi AWT / Java Swing 4 27-08-2009 05:55 AM
Need some help - Urgent aks_java JDBC & Databases 1 04-05-2009 11:30 AM


100 most searched terms
Search Cloud
2 dimensional arraylist java 2d arraylist java actionlistener actionlistener in java addactionlistener addactionlistener java convert double to integer java double format java double to integer in java double to integer java drag en drop programmeren java eclipse shortcut keys exception in thread "awt-eventqueue-0" java.lang.outofmemoryerror: java heap space exception in thread "main" java.lang.nullpointerexception exception in thread "main" java.lang.outofmemoryerror: java heap space format double in java format double java get mouse position java java 2d arraylist java actionlistener java double format java double formatting java double to int java double to integer java format double java forum java forums java get mouse position java list to map java mouse position java programming forum java programming forums java programming practice problems java send keystrokes to another application java two dimensional arraylist java.io.ioexception: premature eof java.lang.classformaterror: truncated class file java.lang.outofmemoryerror: java heap space java.util.arraylist jbutton action jbutton actionlistener jtextarea font jtextfield font size jxl.read.biff.biffexception: unable to recognize ole stream programming mutators and generics smack api two dimensional arraylist two dimensional arraylist java unable to sendviapost to url what is the smallest positive number that is evenly divisible by all of the numbers from 1 to 20?

All times are GMT. The time now is 02:04 AM.
Powered by vBulletin® Copyright ©2000-2009, Jelsoft Enterprises Ltd.