如何将控制台输入分派给不同的进程 [英] How to dispatch console inputs to different processes

查看:67
本文介绍了如何将控制台输入分派给不同的进程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





我正在开发嵌入式Linux内核上的多进程环境。



如何我可以让我的所有精灵在不阻挡其他精灵的情况下听控制台。



例如:



app1.elf - > call getchar()或者类似的

app2.elf - > call getchar()或者类似的

app3.elf - >调用getchar()或类似的



当我按下键盘上的'a'时,我希望所有应用程序都能收到键入的密钥。



目前的行为是,如果输入被app1.elf捕获,其他人什么也得不到。



任何提示都将受到高度赞赏。



提前致谢。

Hi,

I am working on multi process environment on embedded Linux Kernel.

How can I make all of my elfs to listen the console without blocking other elfs.

For example:

app1.elf -> call getchar() or similar
app2.elf -> call getchar() or similar
app3.elf -> call getchar() or similar

When I press the say 'a' from the keyboard I want all applications to receive the typed key.

Current behaviour is that if input is captured by app1.elf the others gets nothing.

Any hint will highly be appreciated.

Thanks in advance.

推荐答案

请看这个令人鼓舞的问题评论。 :-)



这显然很难帮助,因为你显然是在试图解决一些误解,但是我们不知道你的最终目标只有通用才有意义讨论。所以,现在你能得到的只是一些提示。在这里:

http://en.wikipedia.org/wiki/Multithreading_% 28软件%29#多线程 [ ^ ],

http://www.linuxjournal.com/article/3138 [ ^ ],

http://en.wikipedia.org/wiki/Inter-process_communication [ ^ ],

http://en.wikipedia.org/wiki/Socket_API [ ^ ],

http://www.linuxhowtos.org/C_C++/socket.htm [ ^ ]。



-SA
Please see the encouraging comments to the question. :-)

It would be hard to help as you apparently are trying to push some misconceptions, but we don't know your ultimate goals which only would make sense to discuss. So, all you can get now is some hints. Here:
http://en.wikipedia.org/wiki/Multithreading_%28software%29#Multithreading[^],
http://www.linuxjournal.com/article/3138[^],
http://en.wikipedia.org/wiki/Inter-process_communication[^],
http://en.wikipedia.org/wiki/Socket_API[^],
http://www.linuxhowtos.org/C_C++/socket.htm[^].

—SA

这篇关于如何将控制台输入分派给不同的进程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆