RE: enter/leave_critical_section() calls in the user space library

2020-05-11 Thread Xiang Xiao
NuttX become the best SMP RTOS. Thanks Xiang -Original Message- From: spudaneco Sent: Tuesday, May 12, 2020 12:52 PM To: dev@nuttx.apache.org Cc: Nakamura, Yuuichi (Sony) Subject: RE: enter/leave_critical_section() calls in the user space library I don't understand why you need to d

RE: enter/leave_critical_section() calls in the user space library

2020-05-11 Thread spudaneco
x.apache.org Cc: "Nakamura, Yuuichi (Sony)" Subject: RE: enter/leave_critical_section() calls in the user space library Thanks for accepting my PR.Now it's ok for protected build with uniprocessor case, but not sufficient in SMP case.The following files included in the u

RE: enter/leave_critical_section() calls in the user space library

2020-05-11 Thread Nakamura, Yuuichi (Sony)
e may have to be moved into the kernel space. Thanks, Yuuichi Nakamura > -Original Message- > From: Xiang Xiao > Sent: Monday, May 11, 2020 3:20 PM > To: dev@nuttx.apache.org > Subject: RE: enter/leave_critical_section() calls in the user space library > > But we ne

RE: enter/leave_critical_section() calls in the user space library

2020-05-10 Thread Xiang Xiao
Sent: Monday, May 11, 2020 12:35 PM To: dev@nuttx.apache.org Subject: Re: enter/leave_critical_section() calls in the user space library > From this link: > https://linux.die.net/man/3/setlogmask > logmask has per task scope not per thread scope. So we still suffer the > concurrent

Re: enter/leave_critical_section() calls in the user space library

2020-05-10 Thread Gregory Nutt
From this link: https://linux.die.net/man/3/setlogmask logmask has per task scope not per thread scope. So we still suffer the concurrent issue if we change to group-specific logmask. The same text appears in the more authoritative Opengroup.org web page: https://pubs.opengroup.org/onlinepu

Re: enter/leave_critical_section() calls in the user space library

2020-05-10 Thread Nathan Hartman
On Sun, May 10, 2020 at 11:35 PM Xiang Xiao wrote: > From this link: > https://linux.die.net/man/3/setlogmask > logmask has per task scope not per thread scope. So we still suffer the > concurrent issue if we change to group-specific logmask. So if I understand correctly, that means that moving

RE: enter/leave_critical_section() calls in the user space library

2020-05-10 Thread Xiang Xiao
org Subject: Re: enter/leave_critical_section() calls in the user space library > >> One way to make this work correctly would be to remove the logmask as >> a global variable and, instead, put the logic mask in the group >> structure or in the TCB structure. That would make

Re: enter/leave_critical_section() calls in the user space library

2020-05-10 Thread Gregory Nutt
One way to make this work correctly would be to remove the logmask as a global variable and, instead, put the logic mask in the group structure or in the TCB structure. That would make logmask thread safe (in the second case).  This would be the preferred solution. This solution would work

Re: enter/leave_critical_section() calls in the user space library

2020-05-10 Thread Gregory Nutt
One way to make this work correctly would be to remove the logmask as a global variable and, instead, put the logic mask in the group structure or in the TCB structure.  That would make logmask thread safe (in the second case).  This would be the preferred solution. This solution would work.

Re: enter/leave_critical_section() calls in the user space library

2020-05-10 Thread Gregory Nutt
I think enter/leave_critical_section() call should be replaced with semaphore/mutex/spinlock/atomic_ in most case, not only more standard but also more fast in SMP. Especially, multiple core MCU/DSP design extend from desktop to mobile and embedded now. I would consider just removing the ente

RE: enter/leave_critical_section() calls in the user space library

2020-05-10 Thread Nakamura, Yuuichi (Sony)
Hi all, I have tried to simply replace enter/leave_critical_section() into pthread_mutex if not flat build, and issued the PR. It seems works well in uniprocessor, but there are a few remaining enter/leave_critical_section() calls if SMP is used. Thanks, Yuuichi Nakamura > -Original Messag

RE: enter/leave_critical_section() calls in the user space library

2020-05-10 Thread Xiang Xiao
I think enter/leave_critical_section() call should be replaced with semaphore/mutex/spinlock/atomic_ in most case, not only more standard but also more fast in SMP. Especially, multiple core MCU/DSP design extend from desktop to mobile and embedded now. -Original Message- From: Nakamura, Y