首页 > 系统相关 >Xenomai thread migration

Xenomai thread migration

时间:2023-05-04 19:03:45浏览次数:47  
标签:do sched thread CPU migration Xenomai any


Xenomai中的任务需要通过以下方式显示声明CPU迁移, 否则系统不会主动进行迁移。

原因是迁移本身会带来延迟,系统决定不去做迁移的判断。

Xenomai thread migration_sed


> Or is there a complex algorithm to determine who is in a processor in a
> instance ?

No complex algorithm at all. A Xenomai thread is given a static affinity
when it emerges, based on the one linux chose when cloning the new task.
Then the Xenomai app may chose to change that affinity, using the
relevant API calls (i.e. sched_setaffinity for the POSIX one). Xenomai
will notice and maintain consistency between schedulers.

At any rate, Xenomai deliberately refrains from doing any dynamic load
 balancing over CPUs, because this is a latency killer (resuming from a 
 cold cache, cost of the migration process and so on). If a Xenomai 
 thread wants to move to another CPU, it has to request it explicitly.
 We don't know how to do CPU migration efficiently wrt latency, so we 
 don't do it, and accept dumbness.


> Or we can get rid of xnpod_migrate_thread(), it is currently not used by
> any skin.
> 

It's a fundamental feature for placing SMP jobs, and kernel-based
Xenomai threads could not rely on sched_setscheduler() to do it. Let's
keep this service, and simply pass the sched pointer to the accumulation
routine; I was wrong initially suggesting the opposite. IOW, let's avoid
smashing a squadron of flies with nukes...

标签:do,sched,thread,CPU,migration,Xenomai,any
From: https://blog.51cto.com/u_16097040/6244042

相关文章

  • RTThread使用DMA串口接收数据不连续的问题
    RTThread使用DMA接收串口数据的问题问题/现象解决方式解决方式①解决方式②其它疑问问题/现象使用RTThread的DMA接收串口数据,数据不连续,即IDLE中断没有起到作为一个frame的判定.经过对serial和drv_uarts源码的分析,得出原因:graphLRRX_INT[USART1_IRQHandler]-......
  • Runnable和Thread比较
    (一)Thread类实现了Runnable接口吗?在线程使用过程中,我们肯定会用到Runnable与Thread,前者的实现方式是实现其接口即可,后者的实现方式是继承其类。两者实现方式带来最明显的区别就是,由于Java不允许多继承,因此实现了Runnable接口可以再继承其他类,但是Thread明显不可以。我们看看源码......
  • ThreadLocal 详解
    1.ThreadLocal是什么?/为什么要使用ThreadLocal?ThreadLocal是什么?ThreadLocalThreadLocal类位于java.lang包下,由JDK包提供。如果创建了一个ThreadLocal变量,那么访问这个变量的每个线程都会有这个变量的本地副本,多个线程操作这个变量的时候,其实是在操作自己本地内存里的变......
  • cpp multi thread std::lock_guard,mutex
    #include<atomic>#include<chrono>#include<cmath>#include<condition_variable>#include<ctime>#include<fstream>#include<functional>#include<future>#include<iomanip>#include<iostream&g......
  • RTThread的初始化宏(备忘录)
    RTThread的初始化流程方便后续查找.一.初始化接口初始化顺序接口描述1INIT_BOARD_EXPORT(fn)硬件的初始化,此时调度器还未启动2INIT_PREV_EXPORT(fn)主要是用于纯软件的初始化、没有太多依赖的函数3INIT_DEVICE_EXPORT(fn)外设驱动初始化相关,比如网卡设备......
  • cpp multi thread sync via std::atomic<bool>
    #include<atomic>#include<chrono>#include<cmath>#include<condition_variable>#include<ctime>#include<fstream>#include<functional>#include<future>#include<iomanip>#include<iostream&g......
  • Python+UDP+Threading
    Python+UDP+Threading近期用pythonsocket使用TCP协议做了一个小型的数据收发服务器,后来由于在实际场景中使用时,出现网络不佳导致出现错误的情况,改成了使用UDP协议重做了一版,总体效果变好了。下面是通用代码,实际使用时在这基础上进行修改即可。#-*-coding:utf-8-*-import......
  • 线程常用方法join 和threadLocal
     从源码中可以得知,如果想要join方法正常生效,调用join方法的线程对象必须已经调用了start()方法并且未进入终止状态。扩展:从join方法的源码来看,join方法的本质调用的是Object中的wait方法实现线程的阻塞,wait方法的实现原理在后续的文章中在说详细阐述。**但是我们需要知道的是......
  • C++-std::this_thread::get_id()-获取线程id
    C++-std::this_thread::get_id()-获取线程idstd::this_thread::get_id()头文件:<thread>函数:std::this_thread::get_id()用例:std::thread::idthread_id=std::this_thread::get_id();std::thread对象的成员函数get_id()头文件:<thread>函数:std::thread::idget_id()用例:......
  • STM32:RTthread_线程
    1微处理器系统    随着产品功能的增多,裸机系统不能够满足产品需求,引入RTOS实时操作系统的多线程管理,可以增加程序的稳定性逻辑性,便于管理;2线程  通常默认一个能独立实现功能的函数,称之为线程;多线程管理的意思就是这个程序可以实现多个功能管理;  2.1线程栈   ......