… | |
… | |
488 | |
488 | |
489 | These requests are specific to libeio and do not correspond to any OS call. |
489 | These requests are specific to libeio and do not correspond to any OS call. |
490 | |
490 | |
491 | =over 4 |
491 | =over 4 |
492 | |
492 | |
493 | =item eio_mtouch (void *addr, size_t length, int flags, int pri, eio_cb cb, void *data) |
493 | =item eio_mtouch (void *addr, size_t length, int flags, int pri, eio_cb cb, void *data) |
494 | |
494 | |
|
|
495 | Reads (C<flags == 0>) or modifies (C<flags == EIO_MT_MODIFY) the given |
|
|
496 | memory area, page-wise, that is, it reads (or reads and writes back) the |
|
|
497 | first octet of every page that spans the memory area. |
|
|
498 | |
|
|
499 | This can be used to page in some mmapped file, or dirty some pages. Note |
|
|
500 | that dirtying is an unlocked read-write access, so races can ensue when |
|
|
501 | the some other thread modifies the data stored in that memory area. |
|
|
502 | |
495 | =item eio_custom (void (*)(eio_req *) execute, int pri, eio_cb cb, void *data) |
503 | =item eio_custom (void (*)(eio_req *) execute, int pri, eio_cb cb, void *data) |
496 | |
504 | |
497 | Executes a custom request, i.e., a user-specified callback. |
505 | Executes a custom request, i.e., a user-specified callback. |
498 | |
506 | |
499 | The callback gets the C<eio_req *> as parameter and is expected to read |
507 | The callback gets the C<eio_req *> as parameter and is expected to read |
500 | and modify any request-specific members. Specifically, it should set C<< |
508 | and modify any request-specific members. Specifically, it should set C<< |
… | |
… | |
520 | req->result = open (req->data, O_RDONLY); |
528 | req->result = open (req->data, O_RDONLY); |
521 | } |
529 | } |
522 | |
530 | |
523 | eio_custom (my_open, 0, my_open_done, "/etc/passwd"); |
531 | eio_custom (my_open, 0, my_open_done, "/etc/passwd"); |
524 | |
532 | |
525 | =item eio_busy (eio_tstamp delay, int pri, eio_cb cb, void *data) |
533 | =item eio_busy (eio_tstamp delay, int pri, eio_cb cb, void *data) |
526 | |
534 | |
527 | This is a a request that takes C<delay> seconds to execute, but otherwise |
535 | This is a a request that takes C<delay> seconds to execute, but otherwise |
528 | does nothing - it simply puts one of the worker threads to sleep for this |
536 | does nothing - it simply puts one of the worker threads to sleep for this |
529 | long. |
537 | long. |
530 | |
538 | |
531 | This request can be used to artificially increase load, e.g. for debugging |
539 | This request can be used to artificially increase load, e.g. for debugging |
532 | or benchmarking reasons. |
540 | or benchmarking reasons. |
533 | |
541 | |
534 | =item eio_nop (int pri, eio_cb cb, void *data) |
542 | =item eio_nop (int pri, eio_cb cb, void *data) |
535 | |
543 | |
536 | This request does nothing, except go through the whole request cycle. This |
544 | This request does nothing, except go through the whole request cycle. This |
537 | can be used to measure latency or in some cases to simplify code, but is |
545 | can be used to measure latency or in some cases to simplify code, but is |
538 | not really of much use. |
546 | not really of much use. |
539 | |
547 | |