Find Jobs
Hire Freelancers

multi threading java program

₹600-1500 INR

종료됨
게시됨 약 6년 전

₹600-1500 INR

제출할때 지불됩니다
The [login to view URL] program: The first program you will write will be called Starter.java. This program should not be in a package. This program will do four tasks: 1. Read from the user that name of a file containing a list of numbers and the number of threads for the Worker program to create. (The number of threads should be an integer between two and 20.) 2. Create a ProcessBuilder object that will act as a template for the Worker process. The template should run the Worker program (using the java virtual machine command "java") with the command line arguments described below for the [login to view URL] program. 3. Start a new Worker process using the ProcessBuilder. 4. Tie the output of Worker program to the Starter program using the Process class method getInputStream() on the Worker process you created in step 3 and read the results that the Work program writes and display them. The [login to view URL] program: The second program you will write will be called [login to view URL], again with no package. The Worker program will perform the following tasks in the main method: 1. Get the command line arguments for Worker: the number of threads to create and the filename to read, from the main method parameter and place them in variables. 2. Open the file for reading and then, read and store the number in the file. You will probably find it easiest to use an ArrayList to store the numbers. 3. Create the specified number of threads, using the Runnable class you write and create an double array with an element for each thread to store its results. 4. Start the thread you created. 5. Using the Thread join() method, wait for each of the thread to complete. 6. Sum the values in the results array and display the sum of the numbers that were read. You also have to write a class that implements the Runnable interface that the main method uses to create the threads. You should make this class an inner class of the Worker class. This will allow the Runnable class to have access to the static variables of the Worker class, thereby allows the running threads access to threse variables as shared data. The three pieces of shared data needed are the total number of threads, the list of numbers and the result array. The Runnable class should have a private instance variable which will hold the index of the thread object, which will be a number between 0 and the number of threads minus one. This index is assigned by the main method when it create the Runnable class for each thread. The index will be used by the thread object to write its final result to the proper element of the shared result array array and to partition the numbers in the numbers list.
프로젝트 ID: 16252573

프로젝트 정보

9 제안서
원격근무 프로젝트
활동 중 6년 전

돈을 좀 벌 생각이십니까?

프리랜서 입찰의 이점

예산 및 기간 설정
작업 결과에 대한 급여 수급
제안의 개요를 자세히 쓰세요
무료로 프로젝트에 신청하고 입찰할 수 있습니다
9 이 프로젝트에 프리랜서들의 평균 입찰은 ₹1,539 INR입니다.
사용자 아바타
A proposal has not yet been provided
₹1,750 INR 2일에
4.9 (98 건의 리뷰)
5.5
5.5
사용자 아바타
HI, Its a simple thread program I can surely do that for you. I have 8 yrs of java exp. I am new here so I will give my best to get 5/5 ratings. Do have a chat before awarding to someone else I am sure we can work out a deal. Looking forward to work with you
₹1,200 INR 1일에
4.6 (2 건의 리뷰)
1.8
1.8
사용자 아바타
Hello, sir. Thank you for the opportunity. If your deadline is not very short, we can discuss a lower price.
₹1,300 INR 1일에
0.0 (0 건의 리뷰)
0.0
0.0

고객에 대한 정보

국기 (INDIA)
India
0.0
0
2월 8, 2018부터 회원입니다

고객 확인

이 거래선이 등록한 다른 일자리

reactJs and graphQL support
₹12500-37500 INR
감사합니다! 무료 크레딧을 신청할 수 있는 링크를 이메일로 보내드렸습니다.
이메일을 보내는 동안 문제가 발생했습니다. 다시 시도해 주세요.
등록 사용자 전체 등록 건수(일자리)
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
미리 보기 화면을 준비 중...
위치 정보 관련 접근권이 허용되었습니다.
고객님의 로그인 세션이 만료되어, 자동으로 로그아웃 처리가 되었습니다. 다시 로그인하여 주십시오.