Boost.asio avoid the use of pipe
Hi list, I'm currently trying to get a asio based software to run on CNK (a very lightweight kernel) which only implements a subset of the POSIX functions. One of the functions which is not implement is pipe. However, asio uses this in the epoll and select reactor. Is there any possibility to avoid that pipe is used? What options do I have? Cheers, Thomas
On 2 Apr 2014 at 19:20, Thomas Heller wrote:
I'm currently trying to get a asio based software to run on CNK (a very lightweight kernel) which only implements a subset of the POSIX functions. One of the functions which is not implement is pipe. However, asio uses this in the epoll and select reactor. Is there any possibility to avoid that pipe is used? What options do I have?
Yeah, I've faced that problem too before. To be honest, the easiest path overall is to write your own pipe implementation using whatever the native OS provides. One solution I have used in the past is a socket running over loopback, it works and probably isn't that much slower than a proper pipe implementation :) Niall -- Currently unemployed and looking for work in Ireland. Work Portfolio: http://careers.stackoverflow.com/nialldouglas/
On 3. April 2014 11:54:48 MESZ, Niall Douglas
On 2 Apr 2014 at 19:20, Thomas Heller wrote:
I'm currently trying to get a asio based software to run on CNK (a very lightweight kernel) which only implements a subset of the POSIX functions. One of the functions which is not implement is pipe. However, asio uses this in the epoll and select reactor. Is there any possibility to avoid that pipe is used? What options do I have?
Yeah, I've faced that problem too before.
To be honest, the easiest path overall is to write your own pipe implementation using whatever the native OS provides. One solution I have used in the past is a socket running over loopback, it works and probably isn't that much slower than a proper pipe implementation :)
Sounds like a plan... Do you have example code lying around?
Niall
-- Diese Nachricht wurde von meinem Android-Mobiltelefon mit K-9 Mail gesendet.
On 4 Apr 2014 at 0:11, Thomas Heller wrote:
To be honest, the easiest path overall is to write your own pipe implementation using whatever the native OS provides. One solution I have used in the past is a socket running over loopback, it works and probably isn't that much slower than a proper pipe implementation :)
Sounds like a plan... Do you have example code lying around?
Not readily to hand. I wrote that pipe() emulation back when I was still writing for RISC-OS which had sockets but not pipes at that time. That was back in the 1990s. All that code lives on a SCSI hard drive I haven't turned on in well over a decade, nor actually do I even have the means to plug it into anything any more. I do remember there was some funny semantics problem which meant I had to use two socket ports instead of one per pipe to emulate the right behaviour. That could have been a broken sockets library of course. I'd also recommend looking into OOB support, if your micro-OS supports OOB socket data it lets you replicate pipe semantics perfectly, if not disabling Nagle's on a standard TCP stream is the best you can do. Niall -- Currently unemployed and looking for work in Ireland. Work Portfolio: http://careers.stackoverflow.com/nialldouglas/
participants (2)
-
Niall Douglas
-
Thomas Heller