Skip to content

Starting the Io_scheduler structure#10

Open
joseims wants to merge 2 commits into
thiagomanel:masterfrom
joseims:io_scheduling
Open

Starting the Io_scheduler structure#10
joseims wants to merge 2 commits into
thiagomanel:masterfrom
joseims:io_scheduling

Conversation

@joseims

@joseims joseims commented May 29, 2019

Copy link
Copy Markdown
Contributor

Scheduler and Disk as simple classes

@thiagomanel thiagomanel left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just a batch of small sugestions

Comment thread io_scheduling/disk.py Outdated
self.track_size=track_size
self.current_position = 0

def distance(self,new_position):

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

replace new_position by position

Comment thread io_scheduling/disk.py
@@ -0,0 +1,7 @@
class Disk:

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add spaces in the proper places self.track_size=track_size self.track_size = track_size

Comment thread io_scheduling/disk.py Outdated
self.current_position = 0

def distance(self,new_position):
return (self.current_position - new_position)%self.track_size

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

needs an extra space too

Comment thread io_scheduling/scheduler.py Outdated

class Random_scheduler(Scheduler):
def schedule(queue):
return r.randint(0,len(queue))

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it is expected to change the queue (remove the item index by the r.randint(0,len(queue)) (if the queue is not empty)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants