Thrill
0.1
|
#include <disk_queues.hpp>
Public Member Functions | |
~disk_queues () | |
void | add_request (request_ptr &req, disk_id_type disk) |
bool | cancel_request (request_ptr &req, disk_id_type disk) |
request_queue * | get_queue (disk_id_type disk) |
void | make_queue (file *file) |
void | set_priority_op (const request_queue::priority_op &op) |
Public Member Functions inherited from singleton< disk_queues > | |
singleton ()=default | |
singleton (const singleton &)=delete | |
non-copyable: delete copy-constructor More... | |
singleton & | operator= (const singleton &)=delete |
non-copyable: delete assignment operator More... | |
Protected Member Functions | |
disk_queues () | |
Protected Attributes | |
std::mutex | mutex_ |
request_queue_map | queues_ |
Private Types | |
using | disk_id_type = int64_t |
using | request_queue_map = std::map< disk_id_type, request_queue * > |
Additional Inherited Members | |
Public Types inherited from singleton< disk_queues > | |
using | instance_pointer = instance_type * |
using | instance_type = disk_queues |
using | volatile_instance_pointer = volatile instance_pointer |
Static Public Member Functions inherited from singleton< disk_queues > | |
static instance_pointer | create_instance () |
create instance of SubInstanceType and move into singleton More... | |
static void | destroy_instance () |
destroy singleton and mark as invalid More... | |
static instance_pointer | get_instance () |
return instance or create base instance if empty More... | |
static instance_type & | get_ref () |
|
private |
Definition at line 43 of file disk_queues.hpp.
|
private |
Definition at line 44 of file disk_queues.hpp.
|
protected |
Definition at line 26 of file disk_queues.cpp.
References singleton< stats >::get_instance().
~disk_queues | ( | ) |
Definition at line 31 of file disk_queues.cpp.
References disk_queues::mutex_, and disk_queues::queues_.
void add_request | ( | request_ptr & | req, |
disk_id_type | disk | ||
) |
Definition at line 60 of file disk_queues.cpp.
References request_queue::add_request(), CountingPtr< Type, Deleter >::get(), disk_queues::mutex_, and disk_queues::queues_.
Referenced by disk_queued_file::aread(), and disk_queued_file::awrite().
bool cancel_request | ( | request_ptr & | req, |
disk_id_type | disk | ||
) |
Cancel a request. The specified request is canceled unless already being processed. However, cancelation cannot be guaranteed. Cancelled requests must still be waited for in order to ensure correct operation.
req | request to cancel |
disk | disk number for disk that req was scheduled on |
true
iff the request was canceled successfully Definition at line 87 of file disk_queues.cpp.
References disk_queues::mutex_, and disk_queues::queues_.
request_queue * get_queue | ( | disk_id_type | disk | ) |
Definition at line 100 of file disk_queues.cpp.
References disk_queues::mutex_, and disk_queues::queues_.
void make_queue | ( | file * | file | ) |
Definition at line 39 of file disk_queues.cpp.
References file::get_queue_id(), disk_queues::mutex_, and disk_queues::queues_.
void set_priority_op | ( | const request_queue::priority_op & | op | ) |
Changes requests priorities.
op | one of:
|
Definition at line 110 of file disk_queues.cpp.
References disk_queues::mutex_, and disk_queues::queues_.
Referenced by buffered_writer< block_type >::buffered_writer().
|
protected |
Definition at line 47 of file disk_queues.hpp.
Referenced by disk_queues::add_request(), disk_queues::cancel_request(), disk_queues::get_queue(), disk_queues::make_queue(), disk_queues::set_priority_op(), and disk_queues::~disk_queues().
|
protected |
Definition at line 49 of file disk_queues.hpp.
Referenced by disk_queues::add_request(), disk_queues::cancel_request(), disk_queues::get_queue(), disk_queues::make_queue(), disk_queues::set_priority_op(), and disk_queues::~disk_queues().