-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cpu/native: timer interrupt issue #6442
Comments
Shouldn't this be done here: https://github.com/RIOT-OS/RIOT/blob/master/cpu/native/native_cpu.c#L145 ? |
I observed it while testing the callback of the |
Please provide a minimal application that reliably shows the defect. |
So far I'm using |
As just mentioned in #6441 I also realized that in EDIT: had a quick look at it. The scheduler brings riot to the idle thread. There If it helps, running the test application in #6441 enabling output in |
@LudwigKnuepfer try the following "snippet" to see what I mean. It's not that the thread doesn't yield but that the timer stops "working" if fired to fast. Main will print dots until thread 1 wakes and prints a newline character. If you set the line with the #include <stdio.h>
#include "thread.h"
#include "mutex.h"
#include "xtimer.h"
static char stack[THREAD_STACKSIZE_MAIN];
static void *second_thread(void *arg)
{
(void) arg;
while (1) {
xtimer_usleep(1000000);
printf("\n");
}
return NULL;
}
int main(void)
{
xtimer_init();
thread_create(stack,
sizeof(stack),
THREAD_PRIORITY_MAIN - 1,
THREAD_CREATE_WOUT_YIELD | THREAD_CREATE_STACKTEST,
second_thread,
NULL,
"second_thread");
while (1) {
printf(".");
xtimer_usleep(500); /* change this value */
}
} |
@lebrush: I just tested your snippet on macOS and got an interesting behavior:
So for the latter case the main thread seems to stuck or nor context switch is happening. I'll try again with some debug output enabled. |
btw. setting it to 100 also runs |
Thanks for testing! Description changed :-) |
Terribly sorry, but I have no time to properly investigate right now. |
Also: thank you for the thorough bug report! |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If you want me to ignore this issue, please mark it with the "State: don't stale" label. Thank you for your contributions. |
For reference, may be related to #6052 |
I'm inclined to just close this one and blame xtimer. Anyone against this? |
Yeah. |
AFAIK all interrupts shall cause a thread yield (thread_yield_higher
), right?EDIT 01/02/17:
Timer in native stops "working"
if fired too fastsometimes. See #6442 (comment)The text was updated successfully, but these errors were encountered: