Please see my comments inline. 2016-05-26 14:35 GMT-07:00 Christos Zoulas <chris...@zoulas.com>:
> On May 26, 2:08pm, charles.cui1...@gmail.com (Charles Cui) wrote: > -- Subject: Re: pthread library related > > | Hi Christos, > | > | I am studying the pthread libraries in netbsd, and have several > patches > | completed. > | I have attached all of them, which is pretty easy, but can fix some > | problems in user land. > | Note that some of them needs to add more logic. If you can, please give > me > | some comments on them. > > I'll send a separate mail. > > | For the pthread part, I found a deep understanding is necessary to > | implement the feature > | such as cross process synchronization. Also, I found a patch which is > | written by ad (http://www.netbsd.org/~ad/prio_protect.diff) > | I found that patch implements some functions that I need, I am right now > | focusing on how to port > | that patch to my work. > > Sounds good. I would also look at the FreeBSD implementation. > > | Also, there are some missing macros like _SC_<MISS_MICRO>, I found the > | existing code just return the macro > | using _POSIX_<MISS_MICRO>, I am wondering where do you guys enforce the > | limitation in the kernel ? > | To clarify, let's use _SC_TIMER_MAX as an example, the netbsd code just > | returns _POSIX_TIMER_MAX in > | sysconf system call, where can I find the logic to enforce this number > when > | user land allocates more times than this value? > > This might sched some light. > > > http://nxr.netbsd.org/search?q=&project=src&defs=&refs=TIMER_MAX&path=&hist= This is really helpful, actually, I searched _SC_TIMER_MAX and _POSIX_TIMER_MAX in nxr, but the results cannot indicate where these logics can be found. One more question, does other _SC_<MISS_MACRO> has the same naming convention in the kernel? I mean can I always search MISS_MICRO to find the logic for this variable? > > > | Let me know if there are any concerns. > > No, I will send a separate mail with more comments about the source. Please > note that with source commits you should also supply unit-tests (see > http://nxr.netbsd.org/xref/src/tests/lib/libpthread/) for example and also > manual pages. I can help you with both. > Yes, I agree, I will try to add those, let me know if there are examples or rules to follow. > > christos >