Internals

scheduler_node

This Python module implements the scheduler interface for the Robotics in Concert (ROCON) project. It tracks resources and allocates them to ROCON services.

class concert_simple_scheduler.scheduler_node.SimpleSchedulerNode(node_name=u'simple_scheduler', period=rospy.Duration[1000000000])[source]

Simple ROCON scheduler node.

Parameters:
  • node_name – (str) Default name of scheduler node.
  • period – (rospy.Duration) Rescheduling time quantum.
ready_queue = None

Queue of waiting requests.

blocked_queue = None

Queue of blocked requests.

period = None

Time duration between periodic rescheduling.

notification_set = None

Set of requester identifiers to notify.

lock = None

Big Scheduler Lock.

pool = None

Resource pool of known ROCON clients.

sch = None

Scheduler request handler.

callback(rset)[source]

Scheduler request callback.

Called in the scheduler callback thread holding the Big Scheduler Lock.

See: concert_scheduler_requests.Scheduler documentation.

dispatch()[source]

Grant any available resources to ready requests.

Notifies all affected requesters.

free(request, requester_id)[source]

Free all resources allocated for this request.

Parameters:
  • request – (ActiveRequest)
  • requester_id – (uuid.UUID) Unique requester identifier.
notify_requesters()[source]

Notify affected requesters.

Pre:self.notification_set contains requesters to notify.
Post:self.notification_set is empty.
queue(request, requester_id)[source]

Add request to ready queue, making it wait.

Parameters:
  • request (ActiveRequest) – resource request to be queued.
  • requester_id (uuid.UUID) – Unique requester identifier.
reject_request(element, exception)[source]

Reject an invalid queue element.

Parameters:
  • element (QueueElement) – Queue element to reject.
  • exception – Associated exception object.
reschedule(event)[source]

Periodic rescheduling thread.

Moves requests that cannot be satisfied with currently-available resources to the blocked queue. Also checks the blocked queue for requests that can be satisfied due to newly-arrived resources.

Uses the Big Scheduler Lock to serialize these changes with operations done within the scheduler callback thread.

shutdown_requester(requester_id)[source]

Shut down this requester, recovering all resources assigned.

concert_simple_scheduler.scheduler_node.main()[source]

Scheduler node main entry point.

Table Of Contents

Previous topic

Overview

Next topic

Change history

This Page