Re: A question of lock usage in OpenBSD kernel code

2017-07-10 Thread Stuart Henderson
The other answers you've had are good, just a couple of extras: On 2017-07-07, J Doe wrote: > Ok, thank you for clarifying that for me. I will proceed with > development in C. As an aside - do OpenBSD developers track with the > latest standard (C11), or is another

Re: A question of lock usage in OpenBSD kernel code

2017-07-08 Thread Marc Espie
There are actually parts of style(9) that are frequently ignored. I just read over the 'declaring variables' and I'm puzzled. I don't do things that way. The "sorting by size" is from another era, especially when it contradicts itself by mixing up types and pointer to types, which is definitely

Re: A question of lock usage in OpenBSD kernel code

2017-07-08 Thread Marc Espie
On Fri, Jul 07, 2017 at 10:02:44PM -0400, Ted Unangst wrote: > J Doe wrote: > > Ok, thank you for clarifying that for me. I will proceed with development > > in C. As an aside - do OpenBSD developers track with the latest standard > > (C11), or is another standard preferred ? > > mostly c89.

Re: A question of lock usage in OpenBSD kernel code

2017-07-07 Thread Ted Unangst
J Doe wrote: > Ok, thank you for clarifying that for me. I will proceed with development in > C. As an aside - do OpenBSD developers track with the latest standard (C11), > or is another standard preferred ? mostly c89. in particular, don't mix code and declarations.

Re: A question of lock usage in OpenBSD kernel code

2017-07-07 Thread J Doe
Hi Ingo, Thank you for your reply - I've answered inline, below. > On Jul 5, 2017, at 10:14 AM, Ingo Schwarze wrote: > > The OpenBSD way is to write userland network daemons in C, not in C++. Ok, thank you for clarifying that for me. I will proceed with development in C.

Re: A question of lock usage in OpenBSD kernel code

2017-07-05 Thread Ingo Schwarze
Hi, J Doe wrote on Tue, Jul 04, 2017 at 12:02:42AM -0400: > I would like to target OpenBSD with some networking code I am > writing in C++ (again, in user land, not kernel networking code). > I'd like to follow the OpenBSD way The OpenBSD way is to write userland network daemons in C, not in

Re: A question of lock usage in OpenBSD kernel code

2017-07-03 Thread J Doe
>>> On 2017/6/23 23:59, Ted Unangst wrote: >>> >>> Jia-Ju Bai wrote: >>>> >>>> Hi, >>>> >>>> I am a freshman in developing OpenBSD drivers, and I have a question in >>>> lock usage in OpenBSD kernel code.

Re: A question of lock usage in OpenBSD kernel code

2017-06-25 Thread Joel Rees
ing OpenBSD drivers, and I have a question in >>> lock usage in OpenBSD kernel code. >>> >>> I only find two kinds of locks which are often used in OpenBSD drivers, >>> namely "mutex lock" and "rw lock". I want to know which lock can be held >&g

Re: A question of lock usage in OpenBSD kernel code

2017-06-23 Thread Jia-Ju Bai
On 2017/6/23 23:59, Ted Unangst wrote: Jia-Ju Bai wrote: Hi, I am a freshman in developing OpenBSD drivers, and I have a question in lock usage in OpenBSD kernel code. I only find two kinds of locks which are often used in OpenBSD drivers, namely "mutex lock" and "rw lock&q

Re: A question of lock usage in OpenBSD kernel code

2017-06-23 Thread Ted Unangst
Jia-Ju Bai wrote: > Hi, > > I am a freshman in developing OpenBSD drivers, and I have a question in > lock usage in OpenBSD kernel code. > > I only find two kinds of locks which are often used in OpenBSD drivers, > namely "mutex lock" and "rw lock". I w

A question of lock usage in OpenBSD kernel code

2017-06-23 Thread Jia-Ju Bai
Hi, I am a freshman in developing OpenBSD drivers, and I have a question in lock usage in OpenBSD kernel code. I only find two kinds of locks which are often used in OpenBSD drivers, namely "mutex lock" and "rw lock". I want to know which lock can be held when the curr