[Solved] EE328-OPERATING SYSTEM 8

$25

File Name: EE328_OPERATING_SYSTEM_8.zip
File Size: 226.08 KB

SKU: [Solved] EE328-OPERATING SYSTEM 8 Category: Tag:
5/5 - (1 vote)

1 PROBLEM

1.1 DESCRIPTION

Writeaprogramthatcalculatesthematrixmultiplicationwithallthesituationconsidering. You canseethedetailintheendofchapter4ofOPERATINGSYSTEMCONCEPTSWITHJAVA(Seventh Edition), page 162.

2 ALGORITHM

be described as follows:
a11 a12 a21 a22 am1 am[1] where a1n b11a2n b21 ... ... amn bn1 b12 b22bn2 b1q c11b2q c21 ... = ... bnq cm1 c12 c22 ... ... cm2 c1q c2q cmq (1)
n (2)
ci j = X airbr j = ai1b1j +ai2b2j ++a1nbnj,i = 1,2, ,m; j = 1,2, ,qr=12.2 MULTI-THREAD PROGRAMMING

1

Figure 3.1: Screenshot of Matrix Multiplication

2.3 ROBUSTNESS CONSIDERATION

The user input process requires great efforts to avoid illegal input and make sure the program execute normally. First we require user to input 4 integers to denote the rows and columns and create 2 zero matrices. The column number of [A] needs to be the same as the row number of [B] and thus a detection is needed. In the meantime we require the user to input a row at a time so if any illegal input exists the user is supposed to input this row again until he finishes input.

3 RESULTS

3.1 ENVIRONMENT

  • Windows 10
  • Java Development Kit 1.8.0_131
  • Eclipse

3.2 SCREENSHOTS OF THE RESULT

We use command line to compile and execute the program. The result is shown in Fig. 3.1.

3.3 THOUGHTS

It is the first time that I learn multi-thread programming. Although the algorithm is easy it still consumed me lots of time to master multi-thread programming, which benefits me a great deal.

2

[1] .1 MATRIX MULTIPLICATION

Matrix multiplication is able to be executed when the matrices are like [A]mn[B]nq and can

We create mq threads to calculate each element in the result matrix [C]mq using the formula above. After all sub-threads have been terminated, the main thread will print the result. Class CalMatrix is supposed to extend class Thread and override the method run(). Method join() is necessary in the main thread as well.

Reviews

There are no reviews yet.

Only logged in customers who have purchased this product may leave a review.

Shopping Cart
[Solved] EE328-OPERATING SYSTEM 8[Solved] EE328-OPERATING SYSTEM 8
$25