开发者

Portable C++ library for IPC (processes and shared memory), Boost vs ACE vs Poco?

I need a portable C++ library for doing IPC. I used fork() and SysV shared memory until now but this limits开发者_高级运维 me to Linux/Unix. I found out that there are 3 major C++ libraries that offer a portable solution (including Windows and Mac OS X). I really like Boost, and would like to use it but I need processes and it seems like that this is only an experimental branch until now!? I have never heard of ACE or POCO before and thus I am stuck I do not know which one to choose. I need fork(), sleep() (usleep() would be great) and shared memory of course. Performance and documentation are also important criteria.

Thanks, for your Help!


Boost Interprocess has been around since Boost 1.35 (which should be something like 3 years ago if memory serves).

ACE has been around longer, but from the sound of things, it's probably overkill -- ACE is a big library, and you only seem to want a tiny bit of what it includes. That's not necessarily a major problem, but it is something to keep in mind. In particular, a library that's really designed for big projects can tend to seem (or be) a bit clumsy for smaller ones. ACE is also intended primarily for network development, with IPC included because (for example) you might want to build what appears to be a single server out of a number of cooperating processes, and if so you obviously need a way to build those cooperating processes.

POCO is a lot more like ACE -- it's basically a network library that happens to include some IPC capability. Again, you're looking at using a pretty small part of a much larger, more ambitious library.

Based on what you want, I'd probably use Boost -- it seems to be the closest fit for what you've said you want. POCO would probably be my second choice. Although it's separate from Boost, it seems to largely follow similar design philosophy -- in particular it's meant to integrate with the standard library, where ACE tends to be more all-encompassing.


I like to add the Apache portable runtime. It`s not really c++ but of course you can use it. The headers even has the "extern "C"" included.

Included is:

  • Shared Memory
  • Network connections
  • Signals
  • Mutexes
  • many other things.

The problem with boost is that it has strong requirements for the c++ compiler. Especially cross compilers have a problem with e.g. the strong template usage, so that a plain C library is "more portable".

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜