Boost logo

Boost :

From: Ion Gaztañaga (igaztanaga_at_[hidden])
Date: 2008-09-01 14:39:21


Boris wrote:
> On Mon, 01 Sep 2008 17:52:52 +0200, Ion Gaztañaga <igaztanaga_at_[hidden]>
> wrote:
>> [...]I don't have much idea about async I/O but we can try to write
>> something once we know what we need. I might be completly wrong but
>> boost::interprocess::shared_memory_object is based on a file
>> descriptor (shm_open in unix and a plan file on windows) so we can
>> just obtain the handle and see if select() and WaitForMultipleObject()
>> work on them. After all, write() should work on UNIX with a shared
>> memory object descritor.
>
> Hm, sounds like a good idea. Is there any method I could call to access
> the file descriptor and handle? Then I could try and use the same
> Boost.Asio I/O objects as above to check if the idea basically works.

Not yet ;-) But you can just take shared_memory_object class and modify
it adding a function called get_os_handle():

class shared_memory_object
{
    private:
    file_handle_t m_handle;
    mode_t m_mode;
    std::string m_filename;

    //...

    public:
    file_handle_t get_os_handle() const
    { return m_handle; }
}

file_handle_t is an int in UNIX and void * (HANDLE) in windows. I think
that's all we need.

> Boris

Regards,

Ion


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk