From: Zoran V. <zv...@ar...> - 2006-01-02 11:07:29
|
Am 02.01.2006 um 12:06 schrieb Zoran Vasiljevic: > > Am 02.01.2006 um 04:43 schrieb Vlad Seryakov: > >> Tried it, nsd started crashing and i am guessing that the problem >> is combination of aio_write and mmap. >> When is start spooling, i just submit aio_write and return >> immediately, so there are a lot of quick aio_write calls. By the >> time i reach mmap, it looks like it's always ahead of actual >> writing, so even when i am trying to check aio_error/aio_fsync in >> the NsGetRequest, i still get SIGBUS/SIGSEGV when i access reqPtr- >> >content, looks like mmap and aio_write are out of sync. And there >> is no way to wait until all file buffers will be flushed, so >> manual separate thread implementation could be the only portable >> solution. Or i just do not understand aio_xxx things completely. > > Hm... the idea is to mmap the file when all is read from the client. > So you'd have to aio_write into the file until all is received, then > at some point check the aio_status of the write (non-blocking) and > when it's done, revert to mmap the file. I do not believe you can > mix the aio_ with mmap. What I still do not know is: if you are allowed to issue multiple outstanding aio_writes one after another... It might be that you need to check wether the first aio_write is done before you attempt the next one. Zoran |