c - libubox是否支持多线程

标签 c linux openwrt

我正在使用 libubox 做一个项目。我已经指出 libubox 在顺序模式下而不是在多线程模式下执行函数。

有没有人可以证实这一点?

最佳答案

不,libubox不支持多线程

在 Felix(Libubox 开发者)的辩护之后

On 2012-11-07 2:59 PM, KALLEL Mohamed wrote:

Hello

I m contributing in the development of an opensource project which use libubox. and I remarked that libubox execute handler functions in monothread mode and not in muItithread mode.

1) so I m wondering if the libubox supports execution of handler in multi thread mode ?

2) if yes how to activate multithread for registred handlers with libubox

3) if no. I m able to create 2 threads in my main program and then each thread will call libubox functions to register handler function. Could you give a quick how to do it with libubox? Hi,

libubox 中的 uloop 目前并不是以线程安全的方式设计的。我 建议只在一个线程中运行 uloop,然后处理 处理接收到的事件关闭到其他线程。那会是 足以满足您的应用程序的需求,或者您需要任何特定的 变化?

我还没有真正研究过 epoll 的线程安全使用(这是 内部在uloop中使用),只记得最近的一些kernel相关的 讨论指出它的线程使用可能有点棘手 因为最近才修复了一些竞争条件。

  • 菲利克斯

关于c - libubox是否支持多线程,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13265678/

相关文章:

C结构链表段错误

c - 如何将位于结构体中的二维数组中的每个字符保存并加载到文件中? C

c - 请解释下面 printfs 的区别

linux - 如何实现这个功能呢? (这个功能的名字是什么?)

python - 在 python 变量中获取 wget 输出

python - 在 OpenWrt Linux 中的单独分区上启动/重新启动时运行 Python 程序

c - 为什么这段 C 代码会崩溃

linux - 使用 apt-get 时交叉编译

android - Linux编译配置

linux - 如何捕获从无线路由器发送的探测请求数据或探测响应数据