Re: mixed usage of lock protection and lock-free List template class in thread.h

2018-02-16 Thread Xiaofeng Liu via cygwin
], NULL, create_task, (void*)i); } // wait for create_task thread for (size_t i = NTHR_HANDLE_JOB; i < threads.size(); ++i) { pthread_join(threads[i], NULL); } jobs.enqueue(0); // wait for handle_job thread for (size_t i = 0; i < NTHR_HANDLE_JOB; ++i) pt

Re: mixed usage of lock protection and lock-free List template class in thread.h

2018-02-14 Thread Corinna Vinschen
On Feb 14 07:37, Xiaofeng Liu via cygwin wrote: > Sorry, I need send again for another try for the formatting. > > > (Yahoo deleted my spaces. Please reformat the code in your C++ editor > if you want to use the code. Sorry!) You may want to use a good old MUA like thunderbird or mutt :} > Here

Re: mixed usage of lock protection and lock-free List template class in thread.h

2018-02-13 Thread Xiaofeng Liu via cygwin
LE_JOB; i < threads.size(); ++i) { pthread_join(threads[i], NULL); } jobs.enqueue(0); // wait for handle_job thread for (size_t i = 0; i < NTHR_HANDLE_JOB; ++i) pthread_join(threads[i], NULL); } end of test-thread.cpp---------- To: cygwin@cygw

Re: mixed usage of lock protection and lock-free List template class in thread.h

2018-02-13 Thread Xiaofeng Liu via cygwin
observe that the peak memory kept increasing to a few hundred MB, and I suspect there is a MEMORY LEAK in cygwin kernel.  I hope the format will be good. If not, I will try again. Thanks.  Xiaofeng From: Corinna Vinschen To: cygwin@cygwin.com Sent: Friday, December 1, 2017 9:15 AM Subjec

Re: mixed usage of lock protection and lock-free List template class in thread.h

2018-02-13 Thread Xiaofeng Liu via cygwin
ept increasing to a few hundred MB, and I suspect there is a MEMORY LEAK in cygwin kernel.  I hope the format will be good. If not, I will try again. Thanks.  From: Corinna Vinschen To: cygwin@cygwin.com Sent: Friday, December 1, 2017 9:15 AM Subject: Re: mixed usage of lock protection an

Re: mixed usage of lock protection and lock-free List template class in thread.h

2017-12-01 Thread Corinna Vinschen
On Dec 1 16:45, Xiaofeng Liu via cygwin wrote: > Lock protection and lock-free should never be mixed !  > ​https://cygwin.com/git/gitweb.cgi?p=newlib-cygwin.git;a=blob;f=winsup/cygwin/thread.h;hb=1f42dc2bcf58d3b8629eb13d53de3f69fc314b47#l110 > >  110 template inline void 111 List_insert (list_no

mixed usage of lock protection and lock-free List template class in thread.h

2017-12-01 Thread Xiaofeng Liu via cygwin
Lock protection and lock-free should never be mixed !  ​https://cygwin.com/git/gitweb.cgi?p=newlib-cygwin.git;a=blob;f=winsup/cygwin/thread.h;hb=1f42dc2bcf58d3b8629eb13d53de3f69fc314b47#l110  110 template inline void 111 List_insert (list_node *&head, list_node *node) 112 { 113   if (!node) 114