Messages in this thread | | | Date | Thu, 23 Apr 2015 13:45:40 +0000 (UTC) | From | Mathieu Desnoyers <> | Subject | Re: [PATCH v16] sys_membarrier(): system-wide memory barrier (generic, x86) |
| |
----- Original Message ----- > On Wed, 22 Apr 2015 17:40:51 -0700 > Stephen Hemminger <stephen@networkplumber.org> wrote: > > > The syscall should just return 0. > > Let the application not worry about how many CPU's are present > > +1
This is indeed how I implemented it initially. The nice thing about this approach is that if the application don't care much about the overhead of calling sys_membarrier on !SMP, returning 0 tells the application that sys_membarrier is indeed supported, and that the application don't need to issue memory barriers on the other target threads (compiler barrier is then sufficient), which is correct.
I'll update the patch accordingly.
Thanks,
Mathieu
-- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com
| |