来自内核的信号错误
有没有办法让内核中断任务队列并提前将控制权交给主机,从而刷新剩余但未处理的任务?
我将输出数组传递给内核,其中所需的大小事先未知。我正在尝试估计大小,但如果它太小,内核应该将控制权返回给主机,主机可以重新分配它或以其他方式做出反应。目前,我让内核在传递给所有内核的结构中设置一些标志,每个内核在执行时都会检查此错误标志,如果设置了它,则立即退出;这样,队列的其余部分实际上就被跳过了。我想知道是否有更好的方法?例如,我可以从内核生成一个事件吗?
Is there a way for kernel interrupt the task queue and yield control to the host prematurely, flushing the remaining, yet unprocessed tasks?
I am passing output arrays to kernels, of which required size is not known in advance. I am trying to estimate the size, but if it is too small, the kernel should return control to the host, which could re-allocate it or otherwise react. Currently I have the kernel set some flag in a struct which is passed to all kernels, and every kernel checks this error flag when it executes and exits immediately if it is set; this way, the rest of the queue is practically skipped over. I am wondering if there is a better way for this? Can I generate an event from the kernel, for instance?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论