mirror of
https://github.com/apache/nuttx.git
synced 2026-06-06 00:14:22 +08:00
Update TODO and README
This commit is contained in:
@@ -467,21 +467,23 @@ o pthreads (sched/pthreads)
|
|||||||
|
|
||||||
Title: PTHREAD_PRIO_PROTECT
|
Title: PTHREAD_PRIO_PROTECT
|
||||||
Description: Extend pthread_mutexattr_setprotocol() support PTHREAD_PRIO_PROTECT:
|
Description: Extend pthread_mutexattr_setprotocol() support PTHREAD_PRIO_PROTECT:
|
||||||
|
|
||||||
"When a thread owns one or more mutexes initialized with the
|
"When a thread owns one or more mutexes initialized with the
|
||||||
PTHREAD_PRIO_PROTECT protocol, it shall execute at the higher of its
|
PTHREAD_PRIO_PROTECT protocol, it shall execute at the higher of its
|
||||||
priority or the highest of the priority ceilings of all the mutexes
|
priority or the highest of the priority ceilings of all the mutexes
|
||||||
owned by this thread and initialized with this attribute, regardless of
|
owned by this thread and initialized with this attribute, regardless of
|
||||||
whether other threads are blocked on any of these mutexes or not.
|
whether other threads are blocked on any of these mutexes or not.
|
||||||
|
|
||||||
"While a thread is holding a mutex which has been initialized with
|
"While a thread is holding a mutex which has been initialized with
|
||||||
the PTHREAD_PRIO_INHERIT or PTHREAD_PRIO_PROTECT protocol attributes,
|
the PTHREAD_PRIO_INHERIT or PTHREAD_PRIO_PROTECT protocol attributes,
|
||||||
it shall not be subject to being moved to the tail of the scheduling queue
|
it shall not be subject to being moved to the tail of the scheduling queue
|
||||||
at its priority in the event that its original priority is changed,
|
at its priority in the event that its original priority is changed,
|
||||||
such as by a call to sched_setparam(). Likewise, when a thread unlocks
|
such as by a call to sched_setparam(). Likewise, when a thread unlocks
|
||||||
a mutex that has been initialized with the PTHREAD_PRIO_INHERIT or
|
a mutex that has been initialized with the PTHREAD_PRIO_INHERIT or
|
||||||
PTHREAD_PRIO_PROTECT protocol attributes, it shall not be subject to
|
PTHREAD_PRIO_PROTECT protocol attributes, it shall not be subject to
|
||||||
being moved to the tail of the scheduling queue at its priority in the
|
being moved to the tail of the scheduling queue at its priority in the
|
||||||
event that its original priority is changed."
|
event that its original priority is changed."
|
||||||
|
|
||||||
Status: Open. No changes planned.
|
Status: Open. No changes planned.
|
||||||
Priority: Low -- about zero, probably not that useful. Priority inheritance is
|
Priority: Low -- about zero, probably not that useful. Priority inheritance is
|
||||||
already supported and is a much better solution. And it turns out
|
already supported and is a much better solution. And it turns out
|
||||||
@@ -489,39 +491,39 @@ o pthreads (sched/pthreads)
|
|||||||
Excerpted from my post in a Linked-In discussion:
|
Excerpted from my post in a Linked-In discussion:
|
||||||
|
|
||||||
"I started to implement this HLS/"PCP" semaphore in an RTOS that I
|
"I started to implement this HLS/"PCP" semaphore in an RTOS that I
|
||||||
work with (http://www.nuttx.org) and I discovered after doing the
|
work with (http://www.nuttx.org) and I discovered after doing the
|
||||||
analysis and basic code framework that a complete solution for the
|
analysis and basic code framework that a complete solution for the
|
||||||
case of a counting semaphore is still quite complex -- essentially
|
case of a counting semaphore is still quite complex -- essentially
|
||||||
as complex as is priority inheritance.
|
as complex as is priority inheritance.
|
||||||
|
|
||||||
"For example, suppose that a thread takes 3 different HLS semaphores
|
"For example, suppose that a thread takes 3 different HLS semaphores
|
||||||
A, B, and C. Suppose that they are prioritized in that order with
|
A, B, and C. Suppose that they are prioritized in that order with
|
||||||
A the lowest and C the highest. Suppose the thread takes 5 counts
|
A the lowest and C the highest. Suppose the thread takes 5 counts
|
||||||
from A, 3 counts from B, and 2 counts from C. What priority should
|
from A, 3 counts from B, and 2 counts from C. What priority should
|
||||||
it run at? It would have to run at the priority of the highest
|
it run at? It would have to run at the priority of the highest
|
||||||
priority semaphore C. This means that the RTOS must maintain
|
priority semaphore C. This means that the RTOS must maintain
|
||||||
internal information of the priority of every semaphore held by
|
internal information of the priority of every semaphore held by
|
||||||
the thread.
|
the thread.
|
||||||
|
|
||||||
"Now suppose it releases one count on semaphore B. How does the
|
"Now suppose it releases one count on semaphore B. How does the
|
||||||
RTOS know that it still holds 2 counts on B? With some complex
|
RTOS know that it still holds 2 counts on B? With some complex
|
||||||
internal data structure. The RTOS would have to maintain internal
|
internal data structure. The RTOS would have to maintain internal
|
||||||
information about how many counts from each semaphore are held
|
information about how many counts from each semaphore are held
|
||||||
by each thread.
|
by each thread.
|
||||||
|
|
||||||
"How does the RTOS know that it should not decrement the priority
|
"How does the RTOS know that it should not decrement the priority
|
||||||
from the priority of C? Again, only with internal complexity. It
|
from the priority of C? Again, only with internal complexity. It
|
||||||
would have to know the priority of every semaphore held by
|
would have to know the priority of every semaphore held by
|
||||||
every thread.
|
every thread.
|
||||||
|
|
||||||
"Providing the HLS capability on a simple pthread mutex would not
|
"Providing the HLS capability on a simple pthread mutex would not
|
||||||
be such quite such a complex job if you allow only one mutex per
|
be such quite such a complex job if you allow only one mutex per
|
||||||
thread. However, the more general case seems almost as complex
|
thread. However, the more general case seems almost as complex
|
||||||
as priority inheritance. I decided that the implementation does
|
as priority inheritance. I decided that the implementation does
|
||||||
not have value to me. I only wanted it for its reduced
|
not have value to me. I only wanted it for its reduced
|
||||||
complexity; in all other ways I believe that it is the inferior
|
complexity; in all other ways I believe that it is the inferior
|
||||||
solution. So I discarded a few hours of programming. Not a
|
solution. So I discarded a few hours of programming. Not a
|
||||||
big loss from the experience I gained."
|
big loss from the experience I gained."
|
||||||
|
|
||||||
o Message Queues (sched/mqueue)
|
o Message Queues (sched/mqueue)
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|||||||
@@ -145,7 +145,12 @@ Debug Issues
|
|||||||
and software.
|
and software.
|
||||||
|
|
||||||
- I don't see any way to connect JTAG to the ESP32 Core V2 board. There
|
- I don't see any way to connect JTAG to the ESP32 Core V2 board. There
|
||||||
is a USB/Serial converter chip, but that does not look it supports JTAG.
|
is a USB/Serial converter chip, but that does not look like it
|
||||||
|
supports JTAG.
|
||||||
|
|
||||||
|
It may be necessary to make cable. Refer to
|
||||||
|
http://www.esp32.com/viewtopic.php?t=381 "How to debug ESP32 with
|
||||||
|
JTAG / OpenOCD / GDB 1st part connect the hardware."
|
||||||
|
|
||||||
- I need to understand how to use the secondary bootloader. My
|
- I need to understand how to use the secondary bootloader. My
|
||||||
understanding is that it will configure hardware, read a partition
|
understanding is that it will configure hardware, read a partition
|
||||||
|
|||||||
Reference in New Issue
Block a user