- iOS/Objective-C 元类和类别
- objective-c - -1001 错误,当 NSURLSession 通过 httpproxy 和/etc/hosts
- java - 使用网络类获取 url 地址
- ios - 推送通知中不播放声音
我正在 Xenomai 中测试 POSIX 皮肤。我正在尝试从 Raspberry Pi 上的一些 GPIO 读取和写入,当我执行程序时,上下文切换的次数越来越多(在/proc/xenomai/stat/中)。
程序的主体将 GPIO 映射到内存并启动 pthreads。闹事的pthread是这样的:
void *productive_thread(void *arg)
{
struct timespec delay, sleep;
unsigned long over;
delay.tv_sec = 0;
delay.tv_nsec = 10000; // 10 usec
sleep.tv_sec = 0;
sleep.tv_nsec = *(long *)arg;
while(1)
{
// This are the read and write macros (gpio is the address of the GPIO mapping):
// #define GPIO_SET *(gpio+7)
// #define GPIO_CLR *(gpio+10)
// #define GPIO_READ(g) (*(gpio + 13)&(1<<(g)))>>4
while(GPIO_READ(4) != 1);
GPIO_SET = 1 << 17;
clock_nanosleep(CLOCK_REALTIME, 0, &delay, NULL);
GPIO_CLR = 1 << 17;
clock_nanosleep(CLOCK_REALTIME, 0, &sleep, NULL);
}
return NULL;
}
每循环一次,上下文切换的次数就会增加。我怀疑问题出在 clock_nanosleep,因为所有其他操作都是算术运算,但 clock_nanosleep 是在 Xenomai documentation 中定义的.能否以某种方式对其进行改进(使用 POSIX 皮肤)?
最佳答案
当进程休眠时,它会执行自愿的上下文切换。这很好,除非您确实看到错过了最后期限。
关于c - Xenomai clock_nanosleep in POSIX skin跳转到Linux Kernel,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19816030/
这里遇到一个特殊问题。 我正在尝试编译这段代码 https://github.com/severinson/VLC-driver在 Raspberry PI 3 上(使用 xenomai v3.0.3
我编写了一个用户空间应用程序。当我运行 fd = rt_dev_open("/dev/ttyACM0"); 时,出现错误。它说没有这样的设备。但是当我使用 POSIX open() 函数时,它工作得很
我正在创建一个周期线程,它在模拟输出上输出方波信号。我正在使用来自 Xenomai API 的 Posix Skin 和 Analogy。 我使用示波器测试了我的代码的实时性能,并查看了方波信号(频率
我是 Xenomai 的新手,我想测量两点之间的时间。 我想先发送一个 10µs 的脉冲。之后,我等到有中断。 我想测量脉冲和中断之间的时间。我使用“rtmd_clock_read()”函数。所以它返
我需要比较 preempt_rt 补丁、Xenomai 和 RTAI 之间的性能。他们每个人都有自己的基准测试,但没有给出相似的结果,并且并非所有基准测试都适用于所有三个平台。我正在寻找的是一个基准测
我正在编写一个具有多个多线程进程的稍微复杂的软件。因为其中一个我需要实时功能(基本上是为了稳健性),所以我为 Xenomai 修补了我的目标内核,并使用 Xenomai 的 native 皮肤对其进行
我尝试在 xenomai-x.x/examples/rtdm/deriver-api/下运行 tut01-sculpt-derv.c 示例。我运行 makefile 没有错误。 tut01-骨骼-de
我正在运行一个有时需要调用 gettimeofday() 的 Xenomai 实时线程,以便根据 ptpd 找出当前时间。 但是,这样做似乎不安全:特别是,它偶尔会使 Xenomai 线程和 Linu
我想在指定负载下使用延迟测试来测试 Xenomai 功能,但是当我尝试执行命令时出现以下错误。 # ./latency -p 100 sh: ./latency command not found 该
我正在 Xenomai 中测试 POSIX 皮肤。我正在尝试从 Raspberry Pi 上的一些 GPIO 读取和写入,当我执行程序时,上下文切换的次数越来越多(在/proc/xenomai/sta
我是 Xenomai 的新手,所以如果我的问题很愚蠢,请原谅我 我已经使用命令在我的 ubuntu 11.04 中安装了 xenomai 2.4.8 apt-get install libxenoma
我需要在我的 x86 平台上使用 linux 中的上下文切换,类似于 ucontext.h, 但不幸的是,ucontext 使用内核调用来完成它。在我的 Xenomai 环境中,任何内核函数调用都会将
/usr/lib64/gcc/x86_64-suse-linux/4.5/../../../../x86_64-suse-linux/bin/ld: cannot find -lrtdk 我在 ld
我想在 Ubuntu 16.04 LTS 上安装 Xenomai 3。 我无法找到任何合适的安装指南/程序。 请求帮助。 最佳答案 安装钴芯的注意事项 1)下载Ubuntu 16.04.1(v4.4内
这三种实时操作系统框架、扩展或补丁有何区别、优缺点? 我想测量一个 CPU 时间戳计数器 (TSC),每次发送或接收 Wifi 数据帧或确认帧时的时间(以纳秒为单位)。 我意识到需要三种实时技术中的一
我正在使用 buildroot 在内核版本 3 上构建 Xenomai 2。 Buildroot 完成了。现在我试图用“make”命令编译它。当我尝试使用“make”命令进行编译时,它似乎失败了:目标
我是一名优秀的程序员,十分优秀!