CSE3OSA Assignment 2019

{`
  LaTrobe University
  Department of Computer Science and Computer Engineering
  CSE3OSA Assignment 2019
  `}

Objectives

Gain hands on experience with multi-threaded concurrency programming with threads.

Assignment Assessment notes

This assignment is worth 20% of your overall assessment. There are two tasks. Task 1 has 50 marks. Task 2 has 40 marks. Programming Style has 10 marks. Total marks are the sum of the above three. Note the marking guide is at the end of each task. Make sure you target areas that are worth marks.

IMPORTANT: Onsite Assignment Execution Test will be conducted on Friday (9:30am-11:50am; 14:10pm-16:00pm) of 18th October. If you do not do the execution test, you can not get marks of Task 1 and Task 2. Please see the end of this document for more details.

Submission details

Submit Your Coursework via LMS. Also, you need to compile and run your solutions and show me the results during the onsite assignment execution test. Please see the end of this document for more details.

This is an individual assignment. You are not permitted to work as a part of a group when writing this assignment.

System Crashes

Since the nature of the assignment requires multi-threaded and multi-process programming (in bonus task). There is a higher probability of system crashes, especially near the deadline due to many people working at the same time. If a system crashes on the weekend it will be unavailable until Monday. So PLEASE schedule your time so that you don’t leave it all to the last minute.

Thread Implementation

Please do this assignment using C, C++ or Java Threads.

Copying, Plagiarism

Plagiarism is the submission of somebody else’s work in a manner that gives the impression that the work is your own. For individual assignments, plagiarism includes the case where two or more students work collaboratively on the assignment. The Department of Computer Science and Computer Engineering treats plagiarism very seriously. When it is detected, penalties are strictly imposed.

Programming Task

Your task is to implement a memory manager that manages page reads and writes from multiple client threads. In the first programming task the memory manager keeps all the pages in a memory buffer large enough to fit all the pages and the server processes a list of requests and sends them to clients to log. In the second task you extend the solution for task 1 so that requests are sent from the client to the server instead of all the requests originating in the server.

Please look at the Assignment Diagram file in the assignment folder to gain a better understanding of the assignment requirements.c Sample input and output files are also provided in the Sample Files file.

Please do not use sleep anywhere inside your code. Or something that simulates a sleep system call. Eg. while () { }. You are also not allowed to do some kind of busy wait for a condition like ( while (some condition not true) { } ) However you are allowed to use the pause(), pthread_cond_wait() system calls and their Java equivalents to block a thread or process.

Please submit separate source files for each of the two tasks.

Task 1 [50 marks]:

There should be 1 server thread and N client threads, where N is supplied by the user as a command line argument. The server opens a file called “all_requests.dat”, the file has the following format:

<client id><space><read/write><space><page id><space><contents of page>

<client id><space><read/write><space><page id><space><contents of page>

...

client id – refers to the id of the client thread which is between 0 and N – 1. Note this is not the thread id that is assigned by the system.

read/write – refers to whether the request is a read or write request.

page id – refers to id of the page being requested.

contents of page – this field only exists if the request is a write request. It contains the contents of a page that is to be written into the server which is a sequence of alphabet characters (a-z, A-Z) with no spaces or anything else in between and has a maximum size of 4096 characters (size of page for most machines).

Here is a sample “all_requests.dat” file. In this example there are 2 clients with ids of 0 and 1 respectively. Note the read requests do not have any associated page contents.

All_requests.dat file:

0 read 20

1 write 20 helloKKAAA

0 read 1

1 read 21

0 read 20

0 write 8 peter

The server thread also reads from the file called “init_buffer_pages.dat” which contains the initial contents of ALL the buffer pages (you can be sure read and write requests are to pages existing in this file). It has the following format:

<page id><space><contents of the page>

<page id><space><contents of the page>

Here is a sample init_buffer_pages.dat file:

1 abcdefghigkhhLLK

2 ABjjjjjsskskskskksk

20 hellohowareyou

21 HHBGHH

8 JHjhjjsjjkwje

The program should do the following:

Function 1) The server thread starts and reads in the init_buffer_pages.dat file to initialise the memory buffer.

Function 2) Create N client threads, where the number N is taken from the command line.

Function 3) The server thread reads from all_requests.dat file to get the page read or write requests. The server must process these requests in order from the 1st to the last. For example the 2nd request on the list must be processed before the 3rd request.

Function 4) Each client thread should keep a log of the pages that it has read inside a file called “client_log_n” where n is its thread id. The pages read must be written into the log file in the order that they are received from the server. Please note you only need to log read requests. In the case of a write request the server does not need to contact any of the clients. This will let us know if server is processing the requests in the correct order. The beginning of each entry should contain the page id followed by the page contents. Here is the format:

<page id><space><contents of page>

<page id><space><contents of page>

Here is an example (note in the example below the page 20 has changed between the first and last reads):

20 hellohowareyou

1 abcdefghigkhhLLK

20 helloKKAAA

Function 5) Please note that the server must wait for the current client thread to have finished writing its log entry before getting the next thread to log its read request.

Function 6) When all the clients finish their requests the server thread must end and cause the entire process to end.

Marking Guide

Task 1 (50 Marks):

Description

Marks

Function 1

5

Function 2

5

Function 3

10

Function 4

15

Function 5

10

Function 6

5

Please note1) you need to run your program based on if client log files contain the correct data on the assignment execution test;

2) Please add necessary comments in your program to indicate Function 1 - 6.

Task 2 [40 marks]

Extend task 1 so that the requests are issued by the clients instead of the server. The server now do not use the “all_requests.dat” file. Instead every client thread reads from a different input file called “client_requests_n.dat”, where n is the thread id. Note this is not the thread id that is assigned by the system. Note thread id goes from 0 to N-1.

The client request files have the following format:

<request no.><space><read/write><space><page id><space><contents of the page>

<request no.><space><read/write><space><page id><space><contents of the page>

Apart from request no. field the other fields have the same meaning as in the “all_requests.dat” file in task 1.

Note request no. is a number starting from 1 2 3 ... to the total number of requests. You can assume that when you combine all the client request files that all request number starting from 1 to the total number of requests exists. Your job is to process all the requests in ascending request number order. Also note the request numbers within each client request file are always sorted in ascending order.

Here is a sample pair of client request files. In this example there are 2 clients.

client_requests_0.dat file:

1 read 20

4 write 21 hellohowareyou

5 read 21

client_requests_1.dat file:

2 read 21

3 write 20 petermaryjohn

The program should do the following:

1) The server thread starts and reads in the init_buffer_pages.dat file to initialise the memory buffer (same as task 1).

2) Create N client threads, where the number N is taken from the command line (same as task 1).

3) Each thread reads from its own client_request_n.dat file to get the page read or write requests. The requests are sent to the server in the order that they appear in the file. The server must process these requests in ascending request number order.

4) The requests are blocking requests, that is if a request from client x is to read a page client x should not send the next request until the server has provided the requested page to the client x. Similarly for a write request the client x should not issue the next request until it has received confirmation from the server that its write has completed. Requests from different clients can be issued concurrently.

5) Each client thread should keep a log of the pages that it has read inside a file called “client_log_n” where n is its thread id. The pages read must be written into the log file in the order that they are received from the server. (same as task 1)

6a) The server must process the requests in ascending order according to request number specified in the client_requests_n.dat files. For example request number 2 must be processed before request number 3, although request number 3 arrived at the server before request number 2. This can happen since the thread issuing request number 3 may have executed before the thread issuing request number 2.

6b) The server is NOT allowed to open the client_requests_n.dat file or the all_requests.dat file.The server must get the request number and all other request information from the client when the client sends its read or write request.

6c) The clients are NOT allowed to send all their requests at once at the beginning. The client can only send a new request after its previous request has been processed. See point 4 for more details.

6d) Not following the above rules will result in very significant reductions in your mark (you may loose up to 100% of the marks for task 3). The reason is if you don’t follow these rules then this task will be almost the same as task 1.

7) When all the clients finish their requests the server thread must end and cause the entire process to end. (same as task 1)

Marking Guide

Task 2 (40 Marks):

Description

Marks

Function 1

3

Function 2

3

Function 3

3

Function 4

10

Function 5

3

Function 6

15

Function 7

3

Please note1) you need to run your program based on if client log files contain the correct data on the assignment execution test;

2) Please add necessary comments in your program to indicate Function 1 - 7.

Programming Style [10 marks]:

Programming style will be judged on the following:

  1. Correct use of synchronization techniques such as mutex, semaphores, monitors, etc. [5 marks]
  2. Comments / functional decomposition [5 marks]

Total Marks = Marks of Task 1 + Marks of Task 2 + Marks of Programming Style

LMS Submission Details

  • Please ensure that your name and student number is on every file that you submit.
  • Prepare two separate zip files, one for Task 1, and one for Task 2. And then zip up the two files into one file.
  • Submit your zip file via LMS.
  • You can submit the same filename as many times as you like before the assignment deadline; the previously submitted copy will be replaced by the latest one.

Onsite Assignment Execution Test

  • Execution Test will be conducted on Friday (9:30am-11:50am; 14:10pm-16:00pm), 18th October (week 11), BG116. Each student will have around 5 minutes to show the solution. An Assignment Execution Test Signup table will be available from lab 5- lab 9. You can select a time slot from the table for your execution test.
  • You need to compile and run your solutions and show me the results during the assignment execution test.
  • Everyone is required to do the assignment execution test. Please arrange your schedule in advance. If you do not do it, you can not get marks of Task 1 and Task 2.

Diploma Universities Assignments

Laureate International Universities Assignment

Holmes Institute Assignment

Tafe NSW

Yes College Australia

ACC508 Informatics and Financial Applications Task 2 T2, 2019

ACC512 Accounting

ACC520 Legal Regulation of Business Structures Semester 2, 2019

ACCT20074 Contemporary Accounting Theory Term 2 Assessment 3

AERO2463 Computational Engineering Analysis : Assignment 4

B01DBFN212 Database Fundamentals Assessment 1

BE01106 - Business Statistics Assignment

BFA301 Advanced Financial Accounting

BFA504 Accounting Systems Assessment 3

BSB61015 Advanced Diploma of Leadership and Management

BSBADV602 Develop an Advertising Campaign

BSBCOM603 Plan and establish compliance management systems case study

BSBCOM603 Plan and establish compliance management systems Assessment Task 1

BSBCOM603 Plan and establish compliance management systems Assessment Task 2

BSBCOM603 Plan and establish compliance management systems Assessment Task 3

BSBFIM501 Manage Budgets And Financial Plans Assessment Task 1

BSBHRM602 Manage Human Resources Strategic Planning

BSBINM601 Manage Knowledge and Information

BSBWOR501 Assessment Task 3 Plan Personal Development Plan Project

BSBMGT517 Manage Operational Plan

BSBWHS521 Ensure a Safe Workplace For a Work Area

BSBWRK510 Manage employee relations

BUSS1030 Accounting, Business and Society

CAB202 Microprocessors and Digital Systems Assignment Help

CHC40213 Certificate IV in Education Support

CHCAGE001 Facilitate the empowerment of older people

CHCAGE005 Provide support to people living with dementia

CHCCCS023 Support independence and wellbeing

CHCCCS025 Support relationships with carers and families

CHCCOM005 Communicate and CHCLEG001 Work Legally Ethically

CHCDIS002 Follow established person-centred behaviour supports

CHCECE019 Early Childhood Education and Care

CHCHCS001 Provide home and community support services

COMP10002 Foundations of Algorithms

COMP90038 Algorithms and Complexity

COSC2633/2637 Big Data Processing

COSC473 Introduction to Computer Systems

CPCCBC5011A Manage Environmental Management Practices And Processes In Building And Construction

CPCCBC5018A Apply structural Principles Medium rise Construction

CSE3OSA Assignment 2019

ELEC242 2019 Session 2

ENN543 Data Analytics and Optimisation

ENN543 Data Analytics and Optimisation Semester 2, 2019

FINM202 Financial Management Assessment 3 Group Report

Forensic Investigation Case Assignment ECU University

HA2042 Accounting Information Systems T2 2019

HC1010 Holmes Institute Accounting For Business

HC2112 Service Marketing and Relationship Marketing Individual Assignment T2 2019

HC2121 Comparative Business Ethics & Social Responsibility T2 2019

HI5002 Holmes Institute Finance for Business

HI5003 Economics for Business Trimester 2 2019

HI5004 Marketing Management T1 2020 Individual Report

HI5004 Marketing Management T1 2020 Group Report

HI5004 Holmes Institute Marketing Management

HI5014 International Business across Borders Assignment 1

HI5014 International Business across Borders

HI5017 Managerial Accounting T2 2019

HI5017 Managerial Accounting T1 2019

HI5019 Tutorial Questions 1

HI5019 Strategic Information Systems for Business and Enterprise T1 2020

HI5019 Holmes Institute Strategic Information Systems T2

HI5019 T2 2019

HI5019 T1 2019

HI5020 Corporate Accounting T3 2019

HI5020 Corporate Accounting T2 2019

HI6005: Management and Organisations in a Global Environment

HI6006 Tutorial questions

HI6006 Competitive Strategy Individual T1 2020

HI6006 Holmes Institute Competitive Strategy

HI6006 Competitive Strategy T3 2019

HI6007 Statistics for business decisions

HI6007 Assessment 2 T1 2020

HI6007 T1 2019

HI6008 T2 2019

HI6008 Holmes Institute Research Project

HI6025 Accounting Theory and Current Issues

HI6026 Audit, Assurance and Compliance Assignment Help

HI6026 Audit, Assurance and Compliance

HI6027 business and corporate law tutorial Assignment T1 2021

HI6027 Business and Corporate Law T3 2019

HI6027 Business and Corporate Law T2 2019

HI6028 Taxation Theory, Practice and Law T2 2021

Hi6028 taxation theory, practice and law Final Assessment t1 2021

HI6028 Taxation Theory, Practice and Law T2 2019

HI6028 Taxation Theory T1 2019

HI6028 Taxation Law Holmes

HLTAAP001 Recognise healthy body systems

HLTWHS002 Follow safe practices for direct client care

HOTL5003 Hotel Property and Operations

HPS771 - Research Methods in Psychology A

HS2021 Database Design

ICTICT307 Customise packaged software applications for clients

IFN619 Data Analytics for Strategic Decision Makers

INF80028 Business Process Management Swinburne University

ISY2005 Case Assignment Assessment 2

ISYS326: Information Systems Security Assignment 2, Semester 2, 2019

ITAP3010 Developing Data Access Solutions Project

ITECH1103- Big Data and Analytics – Lab 3 – Working with Data Items

ITECH1103- Big Data and Analytics Assignment Semester 1, 2020

ITECH 5500 Professional Research and Communication

Kent Institute Australia Assignment

MA5830 Data Visualisation Assignment 2

MGMT7020 Project Management Plan

Mgt 301 Assessment 3

MGT215 Project Management Individual Assignment

MIS102 Data and Networking Assignment Help

MITS4002 Object Oriented Software Development

MITS5002 Software Engineering Methodology

MKT01760 Tourism Planning Environments Assessment 4

MKT01760 Tourism Planning Environments

MKT01906 International Tourism Systems

MKT5000 Marketing Management S2 2019

MNG03236 Report Writing SCU

MRE5003 Industrial Techniques In Maintenance Management Assignment 4

MRE5003 Industrial Techniques In Maintenance Management Assignment 3

MRE5003 Industrial Techniques In Maintenance Management

Network Security and Mitigation Strategies Answers

NIT2213 Software Engineering Assignment

NSB231 Integrated Nursing Practice Assessment Task 1

Science Literacy Assessment 4

SIT323 Practical Software Development T 2, 2019

SIT718 Using aggregation functions for data analysis

SITXCOM002 Show Social and Cultural Sensitivity

TLIL5055 Manage a supply chain

TLIR5014 Manage Suppliers

USQ ACC5502 Accounting and Financial Management

UTS: 48370 Road and Transport Engineering Assessment 2

CHCAGE001 Facilitate the empowerment of older people

CHCAGE005 Provide support to people living with dementia

CHCCCS011 Meet personal support needs

CHCCCS015 Provide Individualised Support

CHCCCS023 Support independence and wellbeing

CHCCCS025 Support relationships with carers and families

CHCCOM005 Communicate and work in health or community services

CHCDIS001 Contribute to ongoing skills development

CHCDIS002 Follow established person-centred behaviour supports

CHCDIS003 Support community participation and social inclusion

CHCDIS005 Develop and provide person-centred service responses

CHCDIS007 Facilitate the empowerment of people with disability

CHCDIS008 Facilitate community participation and social inclusion

CHCDIS009 Facilitate ongoing skills development

CHCDIS010 Provide person-centred services

CHCDIV001 Work with diverse people

CHCHCS001 Provide home and community support services

CHCLEG001 Work legally and ethically

CHCLEG003 Manage legal and ethical compliance

HLTAAP001 Recognise healthy body systems

HLTAID003 Provide First Aid

HLTHPS007 Administer and monitor medications

HLTWHS002 Follow safe work practices for direct client care

Assignment 2 Introduction to Digital Forensics

MGT603 Systems Thinking Assessment 1

MGT603 Systems Thinking Assessment 2

Hi5017 Managerial Accounting T1 2021

HI6028 Taxation Theory, Practice and Law T1 2021

OODP101 Assessment Task 3 T1 2021

ITNE2003R Network Configuration and Management Project

Australia Universities

ACT

Australian Catholic University

Australian National University

Bond University

Central Queensland University

Charles Darwin University

Charles Sturt University

Curtin University of Technology

Deakin University

Edith Cowan University

Flinders University

Griffith University

Holmes Institute

James Cook University

La Trobe University

Macquarie University

Monash University

Murdoch University

Queensland University of Technology

RMIT University

Southern Cross University

Swinburne University of Technology

University of Adelaide

University of Ballarat

University of Canberra

University of Melbourne

University of Newcastle

University of New England

University of New South Wales

University of Notre Dame Australia

University of Queensland

University of South Australia

University of Southern Queensland

University of Sydney

University of Tasmania

University of Technology Sydney

University of the Sunshine Coast

University of Western Australia

University of Wollongong

Victoria University

Western Sydney University

Year 11 - 12 Certification Assignment

Australian Capital Territory Year 12 Certificate

HSC - Higher School Certificate

NTCE - Northern Territory Certificate of Education

QCE - Queensland Certificate of Education

SACE - South Australian Certificate of Education

TCE - Tasmanian Certificate of Education

VCE - Victorian Certificate of Education

WACE - Western Australia Certificate of Education