
{"id":6437,"date":"2011-12-12T16:53:09","date_gmt":"2011-12-12T16:53:09","guid":{"rendered":"http:\/\/www.beautifulwork.org\/?p=6437"},"modified":"2011-12-12T16:53:09","modified_gmt":"2011-12-12T16:53:09","slug":"__generic_file_aio_write-write-data-to-a-file","status":"publish","type":"post","link":"https:\/\/www.trueangle.org\/index.php\/2011\/12\/12\/__generic_file_aio_write-write-data-to-a-file\/","title":{"rendered":"__generic_file_aio_write &#8211; write data to a file"},"content":{"rendered":"<p>1. __generic_file_aio_write &#8211; write data to a file<\/p>\n<pre>\n ssize_t __generic_file_aio_write(struct kiocb * iocb, const struct iovec * iov, unsigned long nr_segs, loff_t * ppos);\n\niocb    IO state structure (file, offset, etc.)\n\niov     vector with data to write\n\nnr_segs number of segments in the vector\n\nppos    position where to write\n\n\n<\/pre>\n<p>2. Classroom<\/p>\n<pre>\nAsynchronous I\/O,  or non-blocking I\/O,  is a form  of input\/output\nprocessing  that permits  other processing  to continue  before the\ntransmission has finished.  Input  and output (I\/O) operations on a\ncomputer  can  be extremely  slow  compared  to  the processing  of\ndata. An  I\/O device can  incorporate mechanical devices  that must\nphysically move,  such as  a hard drive  seeking a trackto  read or\nwrite; this is often orders  of magnitude slower than the switching\nof  electric current.  For example,  during a  disk  operation that\ntakes ten milliseconds  to perform, a processor that  is clocked at\none     gigahertz    could     have    performed     ten    million\ninstruction-processing cycles.   A simple approach to  I\/O would be\nto start the  access and then wait for it to  complete. But such an\napproach (called  synchronous I\/O or blocking I\/O)  would block the\nprogress  of a  program  while the  communication  is in  progress,\nleaving  system  resources idle.  When  a  program  makes many  I\/O\noperations, this means  that the processor can spend  almost all of\nits   time   idle  waiting   for   I\/O   operations  to   complete.\nAlternatively, it is possible,  but more complicated to predict, to\nstart the  communication and then perform processing  that does not\nrequire  that  the  I\/O  has  completed. This  approach  is  called\nasynchronous input\/output.  Any task  that actually depends  on the\nI\/O having completed (this includes both using the input values and\ncritical operations that claim to assure that a write operation has\nbeen  completed) still  needs  to  wait for  the  I\/O operation  to\ncomplete, and thus is still blocked, but other processing that does\nnot have a dependency on the I\/O operation can continue.\n\nsource : http:\/\/en.wikipedia.org\/wiki\/Asynchronous_I\/O\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>1. __generic_file_aio_write &#8211; write data to a file ssize_t __generic_file_aio_write(struct kiocb * iocb, const struct iovec * iov, unsigned long nr_segs, loff_t * ppos); iocb IO state structure (file, offset, etc.) iov vector with data to write nr_segs number of segments in the vector ppos position where to write 2. Classroom Asynchronous I\/O, or non-blocking &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/www.trueangle.org\/index.php\/2011\/12\/12\/__generic_file_aio_write-write-data-to-a-file\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;__generic_file_aio_write &#8211; write data to a file&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[],"_links":{"self":[{"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/posts\/6437"}],"collection":[{"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/comments?post=6437"}],"version-history":[{"count":0,"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/posts\/6437\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/media?parent=6437"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/categories?post=6437"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/tags?post=6437"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}