[Pharo-project] TreadSafeTranscript proposal
Hi I would really like that we get a threadSafeTranscript so I coded one. If you can comment this would help me. Stef
did you check what the semaphore critical section is protecting? cr, tab, nextPutAll: and more and not protected. then transcriptStream inherits from stream which is not threadsafe, so everything can happen. I think that having a real thread safe output is a must. Stef On Mar 29, 2009, at 5:55 PM, Keith Hodges wrote:
Stéphane Ducasse wrote:
Hi
I would really like that we get a threadSafeTranscript so I coded one. If you can comment this would help me.
Stef What is the difference tot he exisitng one, it has an access semaphore too.
Keith
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
2009/3/29 Stéphane Ducasse <stephane.ducasse@inria.fr>:
did you check what the semaphore critical section is protecting? Â Â Â Â cr, tab, nextPutAll: and more and not protected.
then transcriptStream inherits from stream which is not threadsafe, so everything can happen. I think that having a real thread safe output is a must.
as well as thread-safe updating. Btw, take a look at the http://bugs.squeak.org/view.php?id=7033 The way how Transcript window updates itself is not safe. It should use deferUIMessage to update itself using regular world cycle.
Stef
On Mar 29, 2009, at 5:55 PM, Keith Hodges wrote:
Stéphane Ducasse wrote:
Hi
I would really like that we get a threadSafeTranscript so I coded one. If you can comment this would help me.
Stef What is the difference tot he exisitng one, it has an access semaphore too.
Keith
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
-- Best regards, Igor Stasenko AKA sig.
Igor your change is already in pharo :) since months :) Stef On Mar 29, 2009, at 6:48 PM, Igor Stasenko wrote:
2009/3/29 Stéphane Ducasse <stephane.ducasse@inria.fr>:
did you check what the semaphore critical section is protecting? cr, tab, nextPutAll: and more and not protected.
then transcriptStream inherits from stream which is not threadsafe, so everything can happen. I think that having a real thread safe output is a must.
as well as thread-safe updating. Btw, take a look at the http://bugs.squeak.org/view.php?id=7033
The way how Transcript window updates itself is not safe. It should use deferUIMessage to update itself using regular world cycle.
Stef
On Mar 29, 2009, at 5:55 PM, Keith Hodges wrote:
Stéphane Ducasse wrote:
Hi
I would really like that we get a threadSafeTranscript so I coded one. If you can comment this would help me.
Stef What is the difference tot he exisitng one, it has an access semaphore too.
Keith
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
-- Best regards, Igor Stasenko AKA sig.
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
2009/3/29 Stéphane Ducasse <stephane.ducasse@inria.fr>:
Igor your change is already in pharo :) since months :)
Yes, but method i changes is not related in particular to Transcript. The change applies to all users of PluggableTextMorph. But as for thread-safe transcript, you need to be careful when you sending #changed message (each time you printing something - it sends this message), because it using a notification mechanism to tell listeners that there is something changed. Maybe its worth adding #synchronousChanged method to Object which guards from entry by multiple threads(processes) simueltaneously.
Stef On Mar 29, 2009, at 6:48 PM, Igor Stasenko wrote:
2009/3/29 Stéphane Ducasse <stephane.ducasse@inria.fr>:
did you check what the semaphore critical section is protecting? Â Â Â Â cr, tab, nextPutAll: and more and not protected.
then transcriptStream inherits from stream which is not threadsafe, so everything can happen. I think that having a real thread safe output is a must.
as well as thread-safe updating. Btw, take a look at the http://bugs.squeak.org/view.php?id=7033
The way how Transcript window updates itself is not safe. It should use deferUIMessage to update itself using regular world cycle.
Stef
On Mar 29, 2009, at 5:55 PM, Keith Hodges wrote:
Stéphane Ducasse wrote:
Hi
I would really like that we get a threadSafeTranscript so I coded one. If you can comment this would help me.
Stef What is the difference tot he exisitng one, it has an access semaphore too.
Keith
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
-- Best regards, Igor Stasenko AKA sig.
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
-- Best regards, Igor Stasenko AKA sig.
Oh, TrascriptStream already uses AccessSema.. So, it should wrap a #changed: with it: changed: param self semaphore critical: [ super changed: param ] 2009/3/29 Igor Stasenko <siguctua@gmail.com>:
2009/3/29 Stéphane Ducasse <stephane.ducasse@inria.fr>:
Igor your change is already in pharo :) since months :)
Yes, but method i changes is not related in particular to Transcript. The change applies to all users of PluggableTextMorph.
But as for thread-safe transcript, you need to be careful when you sending #changed message (each time you printing something - it sends this message), because it using a notification mechanism to tell listeners that there is something changed. Maybe its worth adding #synchronousChanged method to Object which guards from entry by multiple threads(processes) simueltaneously.
Stef On Mar 29, 2009, at 6:48 PM, Igor Stasenko wrote:
2009/3/29 Stéphane Ducasse <stephane.ducasse@inria.fr>:
did you check what the semaphore critical section is protecting? Â Â Â Â cr, tab, nextPutAll: and more and not protected.
then transcriptStream inherits from stream which is not threadsafe, so everything can happen. I think that having a real thread safe output is a must.
as well as thread-safe updating. Btw, take a look at the http://bugs.squeak.org/view.php?id=7033
The way how Transcript window updates itself is not safe. It should use deferUIMessage to update itself using regular world cycle.
Stef
On Mar 29, 2009, at 5:55 PM, Keith Hodges wrote:
Stéphane Ducasse wrote:
Hi
I would really like that we get a threadSafeTranscript so I coded one. If you can comment this would help me.
Stef What is the difference tot he exisitng one, it has an access semaphore too.
Keith
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
-- Best regards, Igor Stasenko AKA sig.
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
-- Best regards, Igor Stasenko AKA sig.
-- Best regards, Igor Stasenko AKA sig.
On Mar 29, 2009, at 7:05 PM, Igor Stasenko wrote:
2009/3/29 Stéphane Ducasse <stephane.ducasse@inria.fr>:
Igor your change is already in pharo :) since months :)
Yes, but method i changes is not related in particular to Transcript. The change applies to all users of PluggableTextMorph.
But as for thread-safe transcript, you need to be careful when you sending #changed message (each time you printing something - it sends this message), because it using a notification mechanism to tell listeners that there is something changed. Maybe its worth adding #synchronousChanged method to Object which guards from entry by multiple threads(processes) simueltaneously.
I see. I do not know how to do it but I will look into that.
Stef On Mar 29, 2009, at 6:48 PM, Igor Stasenko wrote:
2009/3/29 Stéphane Ducasse <stephane.ducasse@inria.fr>:
did you check what the semaphore critical section is protecting? cr, tab, nextPutAll: and more and not protected.
then transcriptStream inherits from stream which is not threadsafe, so everything can happen. I think that having a real thread safe output is a must.
as well as thread-safe updating. Btw, take a look at the http://bugs.squeak.org/view.php?id=7033
The way how Transcript window updates itself is not safe. It should use deferUIMessage to update itself using regular world cycle.
Stef
On Mar 29, 2009, at 5:55 PM, Keith Hodges wrote:
Stéphane Ducasse wrote:
Hi
I would really like that we get a threadSafeTranscript so I coded one. If you can comment this would help me.
Stef What is the difference tot he exisitng one, it has an access semaphore too.
Keith
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo- project
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
-- Best regards, Igor Stasenko AKA sig.
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
-- Best regards, Igor Stasenko AKA sig.
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Stéphane Ducasse wrote:
did you check what the semaphore critical section is protecting? cr, tab, nextPutAll: and more and not protected.
then transcriptStream inherits from stream which is not threadsafe, so everything can happen. I think that having a real thread safe output is a must.
Stef
Excellent, please would you publish as an external package, perhaps Tools-Transcript thanks Keith
Yes but I want to kill the old crappy one. so it cannot be an external package :) On Mar 29, 2009, at 8:42 PM, Keith Hodges wrote:
Stéphane Ducasse wrote:
did you check what the semaphore critical section is protecting? cr, tab, nextPutAll: and more and not protected.
then transcriptStream inherits from stream which is not threadsafe, so everything can happen. I think that having a real thread safe output is a must.
Stef
Excellent,
please would you publish as an external package, perhaps Tools- Transcript
thanks
Keith
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Btw, I also wrote a transcript (and workspace) as part of OB-Tools. Lukas On Sun, Mar 29, 2009 at 9:24 PM, Stéphane Ducasse <stephane.ducasse@inria.fr> wrote:
Yes but I want to kill the old crappy one. so it cannot be an external package :)
On Mar 29, 2009, at 8:42 PM, Keith Hodges wrote:
Stéphane Ducasse wrote:
did you check what the semaphore critical section is protecting? Â Â Â cr, tab, nextPutAll: and more and not protected.
then transcriptStream inherits from stream which is not threadsafe, so everything can happen. I think that having a real thread safe output is a must.
Stef
Excellent,
please would you publish as an external package, perhaps Tools- Transcript
thanks
Keith
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
-- Lukas Renggli http://www.lukas-renggli.ch
indeed the idea is that I do not want to see the old one around. Stef On Mar 29, 2009, at 10:31 PM, Keith Hodges wrote:
Stéphane Ducasse wrote:
Yes but I want to kill the old crappy one. so it cannot be an external package :)
Why not? I thought that pharo was supposed to be modular.
Keith
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
On 3/30/09, Stéphane Ducasse <stephane.ducasse@inria.fr> wrote:
Hi
I would really like that we get a threadSafeTranscript so I coded one. If you can comment this would help me.
Personally, I'd replace the Transcript with a logging system. The global variable "Transcript" could be replaced with a logger wrapper. Gulik. -- http://gulik.pbwiki.com/
Michael van der Gulik wrote:
On 3/30/09, Stéphane Ducasse <stephane.ducasse@inria.fr> wrote:
Hi
I would really like that we get a threadSafeTranscript so I coded one. If you can comment this would help me.
Personally, I'd replace the Transcript with a logging system. The global variable "Transcript" could be replaced with a logger wrapper.
Gulik.
Thats just what I have wanted to do for ages. Have you had a look at "Logging"? Keith
Yes could be good So you would write what Logger default .... we could do the same for Transcript but breaks a lot of code and books. but indeed using a toothpick could be nice. Stef
Hi
I would really like that we get a threadSafeTranscript so I coded one. If you can comment this would help me.
Personally, I'd replace the Transcript with a logging system. The global variable "Transcript" could be replaced with a logger wrapper.
Gulik.
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Stéphane Ducasse wrote:
Yes could be good
So you would write what
Logger default ....
we could do the same for Transcript but breaks a lot of code and books. but indeed using a toothpick could be nice.
Stef Logging uses,
self log as the front end, and backends are configured... LogCurrent default adapter add: Transcript. Where adapter returns LogAdapterSet, which can be one of multiple adapters, or nested sets. Adapters include File, Transcript, Syslog, Email, Toothpick, LogEngine Keith
participants (5)
-
Igor Stasenko -
Keith Hodges -
Lukas Renggli -
Michael van der Gulik -
Stéphane Ducasse