Re: Stress test failure with threads
I've managed to repeat it now. The bug that causes condition variables to
hang under stress is fixed in LispWorks 6.1 too.
--
Martin Simmons
LispWorks Ltd
http://www.lispworks.com/
>>>>> On Wed, 13 Jun 2012 21:05:30 -0400, James M Lawrence said:
>
> Are you writing to confirm that it was fixed in one of the 6.0
> patches, or are you looking to reproduce the hang? If the latter then
> run
>
> lispworks-personal-6-0-1-x86-linux, md5 0f836edc2f40485ffb07224485bf44e3
>
> You need to compile the example. I just tried interpreted mode and did
> not see a hang.
>
> On Wed, Jun 13, 2012 at 10:57 AM, Martin Simmons <martin@lispworks.com> wrote:
> >
> > I can't repeat the hanging with the condition variable implementation in
> > LispWorks 6.0 either.
> >
> > --
> > Martin Simmons
> > LispWorks Ltd
> > http://www.lispworks.com/
> >
> >
> >>>>>> On Wed, 13 Jun 2012 09:57:57 -0400, James M Lawrence said:
> >>
> >> Thanks to all who responded. Unless I hear otherwise I'll assume it's fixed.
> >>
> >> On Thu, Jun 7, 2012 at 9:11 PM, <ruslan.abdulkhalikov@accenture.com> wrote:
> >> >
> >> > James,
> >> >
> >> > your test seems to work on LW6.1 Linux Ent...
> >> >
> >> > Cheers
> >> > Rus
> >> >
> >> > -----Original Message-----
> >> > From: owner-lisp-hug@lispworks.com [mailto:owner-lisp-hug@lispworks.com] On Behalf Of James M. Lawrence
> >> > Sent: Friday, 8 June 2012 2:46 AM
> >> > To: lisp-hug@lispworks.com
> >> > Subject: Re: Stress test failure with threads
> >> >
> >> >
> >> > On Thu, Jun 7, 2012 at 10:27 AM, Martin Simmons <martin@lispworks.com> wrote:
> >> >> Yes, this is a bug in the LispWorks 6.0 implementation of semaphores. It is
> >> >> fixed in LispWorks 6.1.
> >> >
> >> > Thanks for the official word.
> >> >
> >> >>> * Also hangs when semaphores are replaced with blocking queues
> >> >>> implemented with condition variables.
> >> >>
> >> >> Please post the code for this, because condition variables don't have the same
> >> >> bug AFAIK.
> >> >
> >> > For simplicity I've replaced the queue with a homemade semaphore. The
> >> > following hung between 500 and 17000 iterations in the course of five
> >> > runs.
> >> >
> >> > (defstruct sema
> >> > (count 0)
> >> > (lock (mp:make-lock :recursivep nil))
> >> > (cvar (mp:make-condition-variable)))
> >> >
> >> > (defun inc-sema (sema)
> >> > (mp:with-lock ((sema-lock sema))
> >> > (incf (sema-count sema))
> >> > (mp:condition-variable-signal (sema-cvar sema))))
> >> >
> >> > (defun dec-sema (sema)
> >> > (mp:with-lock ((sema-lock sema))
> >> > (loop (cond ((plusp (sema-count sema))
> >> > (decf (sema-count sema))
> >> > (return))
> >> > (t
> >> > (mp:condition-variable-wait
> >> > (sema-cvar sema) (sema-lock sema)))))))
> >> >
> >> > (defun test (thread-count)
> >> > (let ((from-threads (make-sema))
> >> > (to-threads (make-sema)))
> >> > (loop repeat thread-count
> >> > do (mp:process-run-function
> >> > "test" nil (lambda ()
> >> > (dec-sema to-threads)
> >> > (inc-sema from-threads))))
> >> > (loop repeat thread-count
> >> > do (inc-sema to-threads))
> >> > (loop repeat thread-count
> >> > do (dec-sema from-threads))))
> >> >
> >> > (defun run ()
> >> > (loop
> >> > (test 16)
> >> > (format t ".")))
> >> >
> >> > _______________________________________________
> >> > Lisp Hug - the mailing list for LispWorks users
> >> > lisp-hug@lispworks.com
> >> > http://www.lispworks.com/support/lisp-hug.html
> >> >
> >> >
> >> >
> >> > ________________________________
> >> > Subject to local law, communications with Accenture and its affiliates including telephone calls and emails (including content), may be monitored by our systems for the purposes of security and the assessment of internal compliance with Accenture policy.
> >> > ______________________________________________________________________________________
> >> >
> >> > www.accenture.com
> >> >
> >> >
> >> > _______________________________________________
> >> > Lisp Hug - the mailing list for LispWorks users
> >> > lisp-hug@lispworks.com
> >> > http://www.lispworks.com/support/lisp-hug.html
> >> >
> >>
> >> _______________________________________________
> >> Lisp Hug - the mailing list for LispWorks users
> >> lisp-hug@lispworks.com
> >> http://www.lispworks.com/support/lisp-hug.html
> >>
> >
> > _______________________________________________
> > Lisp Hug - the mailing list for LispWorks users
> > lisp-hug@lispworks.com
> > http://www.lispworks.com/support/lisp-hug.html
> >
>
> _______________________________________________
> Lisp Hug - the mailing list for LispWorks users
> lisp-hug@lispworks.com
> http://www.lispworks.com/support/lisp-hug.html
>
_______________________________________________
Lisp Hug - the mailing list for LispWorks users
lisp-hug@lispworks.com
http://www.lispworks.com/support/lisp-hug.html