Are Collections threadsafe?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
31 messages Options
12
Reply | Threaded
Open this post in threaded view
|

Re: Are Collections threadsafe?

Andreas.Raab
Philippe Marschall wrote:

> 2008/2/27, Andreas Raab <[hidden email]>:
>> Philippe Marschall wrote:
>>  > http://lists.squeakfoundation.org/pipermail/squeak-dev/2007-December/123045.html
>>  > http://lists.squeakfoundation.org/pipermail/squeak-dev/2007-December/123508.html
>>  > http://lists.squeakfoundation.org/pipermail/squeak-dev/2007-December/123498.html
>>
>>
>> I'm not sure what point you're trying to make here
>
> That we are not uncooperative, don't give out any information and
> simply post "SQUEAK IS TEH SUX"

Right. But how you were you phrasing it?

<quote>
But of course implying there is something wrong with the VM or Image is
considered heresy. If you have such issues, better just fix them
yourself. This is easy because "the source it there" (tm). It was
probably done intentionally so that you could expand your Smalltalk
knowledge.
</quote>

Where in this entire exchange did you get the feeling that at the point
where *actual data* entered the discussion anyone ever told you to "go
fix it yourself"? That is my point after all: If you behave like a pro
you'll be treated like a pro. And if you behave like a whiner the
response will be just as appropriate. That is the open source way.

Cheers,
   - Andreas
_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Re: Are Collections threadsafe?

Philippe Marschall
2008/2/27, Andreas Raab <[hidden email]>:

> Philippe Marschall wrote:
>  > 2008/2/27, Andreas Raab <[hidden email]>:
>  >> Philippe Marschall wrote:
>
> >>  > http://lists.squeakfoundation.org/pipermail/squeak-dev/2007-December/123045.html
>  >>  > http://lists.squeakfoundation.org/pipermail/squeak-dev/2007-December/123508.html
>  >>  > http://lists.squeakfoundation.org/pipermail/squeak-dev/2007-December/123498.html
>  >>
>  >>
>  >> I'm not sure what point you're trying to make here
>  >
>  > That we are not uncooperative, don't give out any information and
>  > simply post "SQUEAK IS TEH SUX"
>
>
> Right. But how you were you phrasing it?
>
>  <quote>
>
> But of course implying there is something wrong with the VM or Image is
>  considered heresy. If you have such issues, better just fix them
>  yourself. This is easy because "the source it there" (tm). It was
>  probably done intentionally so that you could expand your Smalltalk
>  knowledge.
>
> </quote>
>
>  Where in this entire exchange did you get the feeling that at the point
>  where *actual data* entered the discussion anyone ever told you to "go
>  fix it yourself"?

Not in this exchange. It happened in enough exchanges earlier.

Cheers
Philippe

> That is my point after all: If you behave like a pro
>  you'll be treated like a pro. And if you behave like a whiner the
>  response will be just as appropriate. That is the open source way.
>
>
>  Cheers,
>    - Andreas
>  _______________________________________________
>  seaside mailing list
>  [hidden email]
>  http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>
_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Re: Are Collections threadsafe?

Adrian Lienhard
In reply to this post by Andreas.Raab

On Feb 27, 2008, at 08:22 , Andreas Raab wrote:

> [...]

> I'm not sure what point you're trying to make here but this is  
> actually a great example for what I mean. Lukas gave meaningful  
> information in this exchange and as a result we developed a couple  
> of theories and disproved them based on available evidence:
>
> http://lists.squeakfoundation.org/pipermail/squeak-dev/2007-December/123047.html
> http://lists.squeakfoundation.org/pipermail/squeak-dev/2007-December/123499.html
> http://lists.squeakfoundation.org/pipermail/squeak-dev/2007-December/123511.html
>
> I'm not claiming that you will *always* get to a result that  
> satisfies your needs but the above is a great example for the kind  
> of discourse that you can engage in when you provide some actual  
> data. Also, I think we both learned something in this exchange which  
> is where the real value lies - if I ever happen to run into a  
> similar situation the data that Lukas gave will definitely be  
> helpful in tracking this down. And don't worry, we'll get to it but  
> these are hard problems and I think we simply haven't got enough  
> data to determine the root cause of the problem. So if you have more  
> evidence, please share it and please don't be shy to post repeatedly  
> because that's what is needed to fix it.

Here you are ;)

Yesterday, I just happened to see again a Seaside application not  
responding anymore because a mutex was locked forever. However, no  
process was within the critical section that would eventually signal  
the semaphore. We had this problem before with SqueakSource and other  
applications.

After some investigations (and first blaming concurrency issues with  
semaphores), I found the following cause. If there is an exception  
thrown within the critical section but this exception is not caught by  
the application but by the Seaside error handler, then the Seaside  
error handler would generate an error page and return this to the  
user. The error handler calls WASession>>returnResponse:, which  
evaluates the session's escape continuation. Surprisingly, however,  
the continuation does not execute any unwind blocks when terminating  
the current stack (see Continuation>>terminate:). Obviously this is  
the reason why the semaphore of the mutex never gets signaled.

Continuation currentDo: [ :cc |
   [ [ 1/0 ] ensure: [ Transcript show: 'ensure' ] ]
       ifError: [ cc value ] ].

Cheers,
Adrian
_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Re: Are Collections threadsafe?

Philippe Marschall
2008/2/27, Adrian Lienhard <[hidden email]>:

>
>  On Feb 27, 2008, at 08:22 , Andreas Raab wrote:
>
>  > [...]
>
>
>  > I'm not sure what point you're trying to make here but this is
>  > actually a great example for what I mean. Lukas gave meaningful
>  > information in this exchange and as a result we developed a couple
>  > of theories and disproved them based on available evidence:
>  >
>  > http://lists.squeakfoundation.org/pipermail/squeak-dev/2007-December/123047.html
>  > http://lists.squeakfoundation.org/pipermail/squeak-dev/2007-December/123499.html
>  > http://lists.squeakfoundation.org/pipermail/squeak-dev/2007-December/123511.html
>  >
>  > I'm not claiming that you will *always* get to a result that
>  > satisfies your needs but the above is a great example for the kind
>  > of discourse that you can engage in when you provide some actual
>  > data. Also, I think we both learned something in this exchange which
>  > is where the real value lies - if I ever happen to run into a
>  > similar situation the data that Lukas gave will definitely be
>  > helpful in tracking this down. And don't worry, we'll get to it but
>  > these are hard problems and I think we simply haven't got enough
>  > data to determine the root cause of the problem. So if you have more
>  > evidence, please share it and please don't be shy to post repeatedly
>  > because that's what is needed to fix it.
>
>
> Here you are ;)
>
>  Yesterday, I just happened to see again a Seaside application not
>  responding anymore because a mutex was locked forever. However, no
>  process was within the critical section that would eventually signal
>  the semaphore. We had this problem before with SqueakSource and other
>  applications.
>
>  After some investigations (and first blaming concurrency issues with
>  semaphores), I found the following cause. If there is an exception
>  thrown within the critical section but this exception is not caught by
>  the application but by the Seaside error handler, then the Seaside
>  error handler would generate an error page and return this to the
>  user. The error handler calls WASession>>returnResponse:, which
>  evaluates the session's escape continuation. Surprisingly, however,
>  the continuation does not execute any unwind blocks when terminating
>  the current stack (see Continuation>>terminate:). Obviously this is
>  the reason why the semaphore of the mutex never gets signaled.

Wow, I feel really stupid now.  And all those unwind-protect vs.
call-cc wars in Scheme vs. CommonLisp come to my mind.

Philippe

>  Continuation currentDo: [ :cc |
>    [ [ 1/0 ] ensure: [ Transcript show: 'ensure' ] ]
>        ifError: [ cc value ] ].
>
>  Cheers,
>
> Adrian
>
> _______________________________________________
>  seaside mailing list
>  [hidden email]
>  http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>
_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Are Collections threadsafe?

stephane ducasse
In reply to this post by johnmci
Hi john

why don't you sell VMs and VM improvements?
This would be great and you would get money and we would get more  
stable system?
May be this is naive but I would pay on a regular basis for a squeak  
vm for our team.

Stef



On Feb 26, 2008, at 11:49 PM, John M McIntosh wrote:

>
> On Feb 25, 2008, at 9:46 PM, Philippe Marschall wrote:
>
>> Not undetected. They do show up in production. We had for example  
>> once
>> a problem with a db connection pool that was protected by a  
>> Semaphore.
>> Whether it worked or not depended on the priority of the thread
>> accessing it. But of course implying there is something wrong with  
>> the
>> VM or Image is considered heresy. If you have such issues, better  
>> just
>> fix them yourself. This is easy because "the source it there" (tm).  
>> It
>> was probably done intentionally so that you could expand your
>> Smalltalk knowledge.
>>
>> Cheers
>> Philippe
>
>
> Really the problem is actually capturing meaningful data and  
> debugging semaphore and delay
> issues is very difficult because the VM usually is catatonic at this  
> point.  Or something is wrong
> but you don't know what.    There are specialized tools to do VM  
> message tracing or snapshots of
> the squeak VM stacks outside of the image, using perhaps  
> unfortunately special versions of the VM
> which require folks to build their own.
>
> This is not to say we ignore things.
>
> I'll note in the late 90's for example Dan called me and said his  
> squeak image hung after running for a
> month. This was the first clue that macintosh operating systems had  
> become stable enough for you to
> actually run an entire month without rebooting. Issue was  
> millisecond clock rollover cause event loop
> processing to stop after 23+ days.
>
> At camp smaltlalk 4 a bunch of us huddled about a table for an  
> afternoon trying to figure out why
> Delay occasional froze, although we had no data, in the code review  
> we traced to an exposure between
> a check for a condition and a message send that introduced an  
> opportunity for a higher priority task to
> attempt to setup a Delay when the Delay logic was performing a  
> critical structure change.
>
> Then someone say Oh they had really really long delays and that  
> results in large integers going into
> the delay logic, yet the delay logic is dependent on the millisecond  
> clock which only thinks in a much smaller
> number. I recall Tim spent days/weeks figuring out an optimal  
> solution.  Noting of course tampering with
> Delay on the fly, make a mistake and you get to restart your image,  
> or toss it...
>
> We had MC servers lock up and drive people crazy, even the Sophie  
> team which I am on.  Someone else
> finally figured out, no it wasn't a problem with unix sockets, it  
> was a problem in the Morphic Event loop and how
> it services morphs and how it wants to ensure a 60 fps rate by real  
> time calculation  (which I added years ago).
> That prevented the servicing of MC server work threads.
>
> Lately Andreas because he is using Squeak for qwaq pushed out quite  
> a number of fixed to Semaphores, are all
> the issues fixed? Well you need to apply all the patches and see  
> what happens.  So make a mantis report, we'd
> like to see that thought: "Whether it worked or not depended on the  
> priority of the thread
>> accessing it."   I'm sure that would an Andreas think more about  
>> what is going on.
>
> What you see now is Squeak is being much more important to people  
> and issues with stability cannot be
> ignored or glossed over.
>
> Shameless job plug:
>
> Tim and I of course for a fee are quite willing to assist people  
> who think they have a VM issue, if your
> "downtime" is costing you $$$ or causing people to think "Who  
> picked this crummy software?"
> Then by all means give us a call.
>
>
>
> --
> =
> =
> =
> =
> =
> ======================================================================
> John M. McIntosh <[hidden email]>
> Corporate Smalltalk Consulting Ltd.  http://
> www.smalltalkconsulting.com
> =
> =
> =
> =
> =
> ======================================================================
>
>
> _______________________________________________
> seaside mailing list
> [hidden email]
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>
_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Are Collections threadsafe?

johnmci
Mmm diagnostics and tuning. Oddly there doesn't seem to be any interest?

On Feb 27, 2008, at 6:58 AM, stephane ducasse wrote:

> Hi john
>
> why don't you sell VMs and VM improvements?
> This would be great and you would get money and we would get more  
> stable system?
> May be this is naive but I would pay on a regular basis for a squeak  
> vm for our team.
>
> Stef
>

--
=
=
=
========================================================================
John M. McIntosh <[hidden email]>
Corporate Smalltalk Consulting Ltd.  http://www.smalltalkconsulting.com
=
=
=
========================================================================


_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Are Collections threadsafe?

johnmci
In reply to this post by stephane ducasse
I note the nice paypal donation button on my squeak page.  http://www.smalltalkconsulting.com/squeak.html

I further note I don't think anyone pushed it last year.

Likely a different tactic is called for now that Squeak has become  
"Commerical".

On Feb 27, 2008, at 6:58 AM, stephane ducasse wrote:

> Hi john
>
> why don't you sell VMs and VM improvements?
> This would be great and you would get money and we would get more  
> stable system?
> May be this is naive but I would pay on a regular basis for a squeak  
> vm for our team.
>
> Stef
>

--
=
=
=
========================================================================
John M. McIntosh <[hidden email]>
Corporate Smalltalk Consulting Ltd.  http://www.smalltalkconsulting.com
=
=
=
========================================================================


_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Are Collections threadsafe?

stephane ducasse
>
> I note the nice paypal donation button on my squeak page.  http://www.smalltalkconsulting.com/squeak.html

We need a bill stating that we bought a software and then we should be  
able to give :)

>
>
> I further note I don't think anyone pushed it last year.
>
> Likely a different tactic is called for now that Squeak has become  
> "Commerical".
>
> On Feb 27, 2008, at 6:58 AM, stephane ducasse wrote:
>
>> Hi john
>>
>> why don't you sell VMs and VM improvements?
>> This would be great and you would get money and we would get more  
>> stable system?
>> May be this is naive but I would pay on a regular basis for a  
>> squeak vm for our team.
>>
>> Stef
>>
>
> --
> =
> =
> =
> =
> =
> ======================================================================
> John M. McIntosh <[hidden email]>
> Corporate Smalltalk Consulting Ltd.  http://
> www.smalltalkconsulting.com
> =
> =
> =
> =
> =
> ======================================================================
>
>
> _______________________________________________
> seaside mailing list
> [hidden email]
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>

_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Re: Are Collections threadsafe?

stephane ducasse
In reply to this post by Philippe Marschall
>>>
>
> Wow, I feel really stupid now.  And all those unwind-protect vs.
> call-cc wars in Scheme vs. CommonLisp come to my mind.
>
> Philippe

Philippe

You should not feel stupid :)
but from an outsider sometimes your statements are a bit too strong :)

Stef
_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

RE: Re: Are Collections threadsafe?

Ron Teitelbaum
Hahahaha!!  That was funny.  

By the way I think you are all great!  Everyone has their quirks.  I've yet
to meet a talented developer that wasn't quirky!  

I was very happy to see this work itself out.  We are all capable of
discussing issues.  The problem is that everyone is so pressed for time that
it can feel like things are ignored, even very important pressing things.
Andreas is right when he said provide as much data as possible and often if
you really need help.  I've seen some very difficult problems solved this
way.  

Ok so back to being a happy friendly community!

Ron

> -----Original Message-----
> From: [hidden email] [mailto:seaside-
> [hidden email]] On Behalf Of stephane ducasse
> Sent: Thursday, February 28, 2008 5:02 AM
> To: Seaside - general discussion
> Subject: Re: [Seaside] Re: Are Collections threadsafe?
>
> >>>
> >
> > Wow, I feel really stupid now.  And all those unwind-protect vs.
> > call-cc wars in Scheme vs. CommonLisp come to my mind.
> >
> > Philippe
>
> Philippe
>
> You should not feel stupid :)
> but from an outsider sometimes your statements are a bit too strong :)
>
> Stef
> _______________________________________________
> seaside mailing list
> [hidden email]
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside

_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Re: Are Collections threadsafe?

Philippe Marschall
2008/2/28, Ron Teitelbaum <[hidden email]>:

> Hahahaha!!  That was funny.
>
>  By the way I think you are all great!  Everyone has their quirks.  I've yet
>  to meet a talented developer that wasn't quirky!
>
>  I was very happy to see this work itself out.  We are all capable of
>  discussing issues.  The problem is that everyone is so pressed for time that
>  it can feel like things are ignored, even very important pressing things.
>  Andreas is right when he said provide as much data as possible and often if
>  you really need help.  I've seen some very difficult problems solved this
>  way.
>
>  Ok so back to being a happy friendly community!

Well there's an other positive side effect (in addition to this and
stuff gets fixed): Instantiations will get their Seaside version for
free.

Cheers
Philippe

>  Ron
>
>
>  > -----Original Message-----
>  > From: [hidden email] [mailto:seaside-
>  > [hidden email]] On Behalf Of stephane ducasse
>  > Sent: Thursday, February 28, 2008 5:02 AM
>  > To: Seaside - general discussion
>  > Subject: Re: [Seaside] Re: Are Collections threadsafe?
>  >
>  > >>>
>  > >
>  > > Wow, I feel really stupid now.  And all those unwind-protect vs.
>  > > call-cc wars in Scheme vs. CommonLisp come to my mind.
>  > >
>  > > Philippe
>  >
>  > Philippe
>  >
>  > You should not feel stupid :)
>  > but from an outsider sometimes your statements are a bit too strong :)
>  >
>  > Stef
>  > _______________________________________________
>  > seaside mailing list
>  > [hidden email]
>  > http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>
>  _______________________________________________
>  seaside mailing list
>  [hidden email]
>  http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>
_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
12