Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

What is Staggered Process Scheduling? Need to implement a solution below based on the staggered process scheduling. (1) The below is a working shell script

What is "Staggered Process Scheduling"? Need to implement a solution below based on the staggered process scheduling.

(1) The below is a working shell script which creates a file "file1.txt" with one million records of random numbers:

for i in {1..1000000}

do echo $RANDOM >> file1.txt

done

(2) The below is a working Python code which reads record from above "file1.txt", then calculates the double of that number and then write the result in "file2.txt":

f1 = open("file1.txt",'r') all_lines = f1.readlines()

f2 = open("file2.txt",'w') dn = 0

for l in all_lines: dn = int(l) * 2 f2.write(str(dn) + ' ')

f2.close()

(3) Need a working Python code which breaks the input file "file1.txt" (from above) into 5 files/chunks and schedule processes to run 30 seconds or 1 minute apart, then combine the resulting files into a single output file.

NOTE: Please don't give pseudo code but provide an actual Python code.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Machine Learning And Knowledge Discovery In Databases European Conference Ecml Pkdd 2016 Riva Del Garda Italy September 19 23 2016 Proceedings Part 1 Lnai 9851

Authors: Paolo Frasconi ,Niels Landwehr ,Giuseppe Manco ,Jilles Vreeken

1st Edition

3319461273, 978-3319461274

More Books

Students also viewed these Databases questions

Question

What will you do or say to Anthony about this issue?

Answered: 1 week ago