Skip to content
This repository has been archived by the owner on Nov 3, 2023. It is now read-only.

修改libLoader插件加载模型 #154

Closed
Antares0982 opened this issue Nov 27, 2022 · 0 comments
Closed

修改libLoader插件加载模型 #154

Antares0982 opened this issue Nov 27, 2022 · 0 comments
Assignees
Labels
p: secondary 优先级:次要 t: enhancement 类型:改进或新特性

Comments

@Antares0982
Copy link
Collaborator

功能描述

现在单个插件绑定单个线程,线程如果在插件中被阻塞将导致后续事件无法接收(如,nextMessage)。为保证最大程度并发,广播任务以及启用/禁用任务将在线程池中随机派发给工作线程,通过thread local变量绑定当前工作中的插件名称到工作线程。

libLoader线程当前为轮询来处理插件加载卸载任务。但这样会造成大量cpu资源浪费。以及libLoader线程应负责定时任务的工作。使用信号量解决这些问题,唤醒后再tick。

PlatformExceptionHandler可以通过thread local的变量判断当前线程工作中的插件并卸载对应插件。

API change:loader api将新增一个函数指针,用户编程时无感知,但实现该功能的前后版本无法兼容。

原因

如上

组件选择

loader

@Antares0982 Antares0982 added t: enhancement 类型:改进或新特性 p: secondary 优先级:次要 labels Nov 27, 2022
@Antares0982 Antares0982 self-assigned this Nov 27, 2022
@Antares0982 Antares0982 mentioned this issue Dec 17, 2022
8 tasks
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
p: secondary 优先级:次要 t: enhancement 类型:改进或新特性
Projects
None yet
Development

No branches or pull requests

1 participant