Re: thread scheduling

2025-11-27 Thread Tim Hardisty
I will find out when I get to try this soon and report back. All my threads have equal priority, although I have tried increasing the priority of the LVGL thread. Most of the time, all threads are blocked waiting on events (e.g. incoming CAN data - but I have stopped the stream for this investi

Re: thread scheduling

2025-11-27 Thread Alan C. Assis
Hi Philippe, Yes, this is my understanding too. Probably the LVGL thread on Tim's configuration is not with the right priority, if this is the case disabling RR will not help much. BR, Alan On Thu, Nov 27, 2025 at 7:35 AM Philippe Leduc via dev wrote: > Hello all, > > I'm not sure to underst

Re: thread scheduling

2025-11-27 Thread Philippe Leduc via dev
Hello all, I'm not sure to understand the problem: the RR time slice shall follow a strict priority ordering no? This time slice only applies if threads have the same priority and that the current one do not yield/sleep.  With a FIFO policy, it would be infinite instead of RR time slice. What a

Re: thread scheduling

2025-11-26 Thread Tomek CEDRO
On Thu, Nov 27, 2025 at 1:37 AM Nathan Hartman wrote: > On Wed, Nov 26, 2025 at 5:19 PM Tomek CEDRO wrote: > > On Wed, Nov 26, 2025 at 11:10 PM Nathan Hartman > > wrote: > > > On Wed, Nov 26, 2025 at 4:48 PM Tomek CEDRO wrote: > > > > Another story is about LaTeX.. I want NuttX to have PDF Hand

Re: thread scheduling

2025-11-26 Thread Nathan Hartman
On Wed, Nov 26, 2025 at 5:19 PM Tomek CEDRO wrote: > On Wed, Nov 26, 2025 at 11:10 PM Nathan Hartman > wrote: > > On Wed, Nov 26, 2025 at 4:48 PM Tomek CEDRO wrote: > > > Another story is about LaTeX.. I want NuttX to have PDF Handbook > > > generated too for offline work and as part of release

Re: thread scheduling

2025-11-26 Thread Tomek CEDRO
On Wed, Nov 26, 2025 at 11:10 PM Nathan Hartman wrote: > On Wed, Nov 26, 2025 at 4:48 PM Tomek CEDRO wrote: > > Another story is about LaTeX.. I want NuttX to have PDF Handbook > > generated too for offline work and as part of releases.. there was > > initial prototype created and it works. But l

Re: thread scheduling

2025-11-26 Thread Nathan Hartman
On Wed, Nov 26, 2025 at 4:48 PM Tomek CEDRO wrote: > > Another story is about LaTeX.. I want NuttX to have PDF Handbook > generated too for offline work and as part of releases.. there was > initial prototype created and it works. But local LaTeX setup is > complex and heavy and in search for alt

Re: thread scheduling

2025-11-26 Thread Tomek CEDRO
Ah sorry I just jumped in to reading :-) As Ludovic pointed out it is possible to do a live preview. We use Sphinx for documentation. HTML preview is generated quickly and smoothly :-) Sphinx is very nice and have tons of features (through plugins/modules). I use it in my projects too. The RST is

Re: thread scheduling

2025-11-26 Thread Tim Hardisty
Aha - thanks for that :-) On 26/11/2025 20:11, Ludovic Vanasse wrote: Ah, just the autorebuild part: DOCUMENTATION — NUTTX LATEST DOCUMENTATION https://nuttx.apache.org/docs/latest/contributing/documentation.html#live-rebuild For me, I was doing the work in VSCode also and just having my br

Re: thread scheduling

2025-11-26 Thread Ludovic Vanasse
Ah, just the autorebuild part:  DOCUMENTATION — NUTTX LATEST DOCUMENTATION https://nuttx.apache.org/docs/latest/contributing/documentation.html#live-rebuild For me, I was doing the work in VSCode also and just having my browser on the side where the preview would be.  __ Ludovic Vanasse m.

Re: thread scheduling

2025-11-26 Thread Tim Hardisty
I simply follow: https://nuttx.apache.org/docs/latest/contributing/documentation.html This is a PITA as you can't just make a change and expect it to be OK. I started working on a simple documentation mod just the other day - in VS Code - but the RST previewers online or within VS Code failed

Re: thread scheduling

2025-11-26 Thread Ludovic Vanasse
Having done a bit of documentation rework in the past. There's a hot reload function in the documentation generation. It'll start a rebuild and refresh the page with the new edit. I thought it was pretty convenient on my machine and we have the Nix devshell for it also, so no need to install anyth

Re: thread scheduling

2025-11-26 Thread Tim Hardisty
This would need only a trivial change to documentation, which then doesn't need a full RST build/check I would think. On 26/11/2025 19:04, Tim Hardisty wrote: Think my message passed yours in the ether...yes; that's what I'm suggesting :-) On 26/11/2025 19:02, Alan C. Assis wrote: I think w

Re: thread scheduling

2025-11-26 Thread Tim Hardisty
Think my message passed yours in the ether...yes; that's what I'm suggesting :-) On 26/11/2025 19:02, Alan C. Assis wrote: I think what we are calling "Strict Priority" is defined by POSIX as SCHED_FIFO. SCHED_FIFO: The thread runs until it blocks itself or it is preempted by a higher priority

Re: thread scheduling

2025-11-26 Thread Alan C. Assis
I think what we are calling "Strict Priority" is defined by POSIX as SCHED_FIFO. SCHED_FIFO: The thread runs until it blocks itself or it is preempted by a higher priority thread. (This is what you want). SCHED_RR: The thread runs until the above happens *OR* its time slice (200ms) expires. So,

Re: thread scheduling

2025-11-26 Thread Tim Hardisty
Think it's SCHED_FIFO - SCHED_PRIORITY was my invention lol On 26/11/2025 18:40, Alan C. Assis wrote: I think SCHED_PRIORITY is not a standard definition, at least I didn't find it in POSIX.

Re: thread scheduling

2025-11-26 Thread Tim Hardisty
This could be just my inexperience with using an RTOS (and NuttX)! This stems from me having a thread to handle LVGL. It seems to only run its usual update function every 200ms - the RR default - rather than the supposed 1ms it wants; but I am yet to try and prove this to be fair. If I'm righ

Re: thread scheduling

2025-11-26 Thread Alan C. Assis
Do you suggest moving from RST to Markdown? I think SCHED_PRIORITY is not a standard definition, at least I didn't find it in POSIX. You can propose using RR slice equal 0 by default, but I don't know the side effects (it could be considered a breaking change, because some user applications could

Re: thread scheduling

2025-11-26 Thread Alan C. Assis
Yes, the Documentation needs to be fixed first. Setting RR slice to 0 by default could be an option to get the Documentation fixed, but I think Greg setup RR slice to 200ms to avoid mistakes, although NuttX is a RTOS most users will want to use it more like a time sharing system. This is my suppo

Re: thread scheduling

2025-11-26 Thread Tim Hardisty
I don't mind doing documentation - but it does take a lot more effort since RST doesn't have very good previewers that I have found: it is difficult to know if will it render correctly on the website unless you do the whole RST build stuff. Quicker - if agreeable as a short term fix - would be

Re: thread scheduling

2025-11-26 Thread Matteo Golin
I agree with your assessment Tim, it is definitely misleading and should be improved! On Wed, Nov 26, 2025 at 1:17 PM Tim Hardisty wrote: > OK - but see here: > https://nuttx.apache.org/docs/latest/reference/user/02_task_scheduling.html > > Hardly a "default" if you have to read the help of Kcon

Re: thread scheduling

2025-11-26 Thread Tim Hardisty
OK - but see here: https://nuttx.apache.org/docs/latest/reference/user/02_task_scheduling.html Hardly a "default" if you have to read the help of Kconfig to see what's going on? I know the documentation is, um, lacking...so if it can be improved here let's do it! On 26/11/2025 18:12, Alan

Re: thread scheduling

2025-11-26 Thread Alan C. Assis
Guess what? We are still missing a proper Documentation! :-) BR, Alan On Wed, Nov 26, 2025 at 3:11 PM Tim Hardisty wrote: > So do we agree the documentation is at best misleading? And, to me, > simply wrong? > > On 26/11/2025 18:07, Alan C. Assis wrote: > > Exactly! > > > > You can refer to sc

Re: thread scheduling

2025-11-26 Thread Alan C. Assis
There is not a checkbox to ROUND ROBIN in the menuconfig: [image: image.png] Only for Sporadic scheduling. The the for the RR timeslice explains it: │ The round robin timeslice will be set this number of milliseconds; │ │ Round robin scheduling (SCHED_RR) is enabled by setting this │

Re: thread scheduling

2025-11-26 Thread Tim Hardisty
So do we agree the documentation is at best misleading? And, to me, simply wrong? On 26/11/2025 18:07, Alan C. Assis wrote: Exactly! You can refer to sched/sched/sched_timerexpiration.c line 207 On Wed, Nov 26, 2025 at 3:00 PM Tim Hardisty wrote: That's what I inferred (yet to try it) - so

Re: thread scheduling

2025-11-26 Thread Alan C. Assis
Exactly! You can refer to sched/sched/sched_timerexpiration.c line 207 On Wed, Nov 26, 2025 at 3:00 PM Tim Hardisty wrote: > That's what I inferred (yet to try it) - so is the documentation > misleading since the default CONFIG_RR_INTERVAL=200 forces RR scheduling > rather than the stated "stri

Re: thread scheduling

2025-11-26 Thread Matteo Golin
I suppose I would agree, that does seem misleading if the default is RR. Does the RR scheduling on NuttX have priority-based preemption/priority inversion avoidance mechanisms? Maybe that could be the reasoning for the wording. On Wed, Nov 26, 2025 at 1:00 PM Tim Hardisty wrote: > That's what I

Re: thread scheduling

2025-11-26 Thread Tim Hardisty
That's what I inferred (yet to try it) - so is the documentation misleading since the default CONFIG_RR_INTERVAL=200 forces RR scheduling rather than the stated "strict priority scheduling"? On 26/11/2025 17:54, Alan C. Assis wrote: CONFIG_RR_INTERVAL=0 On Wed, Nov 26, 2025 at 2:22 PM Tim Har

Re: thread scheduling

2025-11-26 Thread Alan C. Assis
CONFIG_RR_INTERVAL=0 On Wed, Nov 26, 2025 at 2:22 PM Tim Hardisty wrote: > Apologies if this isn't really a NuttX question... > > Documentation says "By default, NuttX performs strict priority scheduling". > > Default CONFIG_RR_INTERVAL is 200ms. > > I have multiple threads, but have not set any

thread scheduling

2025-11-26 Thread Tim Hardisty
Apologies if this isn't really a NuttX question... Documentation says "By default, NuttX performs strict priority scheduling". Default CONFIG_RR_INTERVAL is 200ms. I have multiple threads, but have not set any scheduling parameters, but it seems threads are being scheduled every 200ms rather o