Solaris 门的 Linux 实现
我正在将一些 Solaris 代码移植到 Linux。此代码使用 Solaris 特定的门函数。
Linux 有等效的吗?我找到了几个例子,但它们似乎已经很多年没有更新了。
I am porting some Solaris code to Linux. This code uses the Solaris-specific door functions.
Is there a Linux equivalent? I found a couple of examples but they don't appear to have been updated for many years.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
索拉里斯门速度太慢了。例如,另一个进程中的门呼叫共享呼叫者的同一进程调度程序的时间片。我真的怀疑你是否可以用 Corba 来实现这一点,如果你的应用程序中的门因为它的速度而被使用,你可能会遇到性能问题。我建议你使用另一个unix IPC(已经提到共享内存,...),但这当然取决于你的应用程序。
Solaris doors are a speed bastard. For example, call to the door in an another process shares the same process scheduler's timeslice of the caller. I really doubt you can get this with Corba and if doors in your application are used because of its speed, you may run into performance problems. I would suggest you to use another unix IPC(already mentioned shared memory, ... ), but that of course depends on your application.
Wiki 说它是 RPC 和 Solaris 特定的。在 Linux 上的 RPC 上,您可以使用 Corba 来实现此目的。谷歌搜索“Linux Corba”显示了很多点击。
由于可移植性显然成为一个问题,首先,在实际移植之前,将应用程序转换为使用某些可移植的 RPC 框架(Corba 可能是最可移植的)非常有意义。如果不考虑可移植性,那么 D-Bus 似乎已成为事实上的标准适用于 Linux 上的 IPC。
Wikipedia 上的Door 的文章也提到该机制还允许传递列表来回的文件描述符。在 Linux 上,检查
man 7 unix
以获得 SCM_RIGHTS。Wiki says it is an RPC and Solaris-specific at that. On Linux for RPC you can use Corba for the purpose. Googling for "Linux Corba" shows lots of hits.
As portability apparently becomes a concern, first, before the actual porting, converting the application to use some portable RPC framework (Corba probably the most portable) makes a lot of sense. If portability isn't concern then the D-Bus seems has became the de facto standard for the IPC on Linux.
Door's article on Wikipedia also mentions that the mechanism also allows to pass list of file descriptors back and forth. On Linux check
man 7 unix
for SCM_RIGHTS.正如您所知,Linux 没有门。门是一种不同的 RPC 机制。您几乎必须使用共享内存重新编码。或者使用 API。
Linux does not have doors, as you already know. Doors are a kind of different RPC mechanism. You are pretty much going to have to recode using shared memory. Or use an API.