help-smalltalk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Help-smalltalk] UUID and Monitor Squeak classes equivalent in gst?


From: Nicolas Petton
Subject: Re: [Help-smalltalk] UUID and Monitor Squeak classes equivalent in gst?
Date: Wed, 17 Jun 2009 19:47:54 +0200

It works fine, thanks :)


Le mercredi 17 juin 2009 à 15:29 +0200, Paolo Bonzini a écrit :
> Nicolas Petton wrote:
> > Thanks Paolo, I'll have a look at those classes.
> > 
> > One other question, is there something like the MessageTally class in
> > Squeak?.
> 
> I usually use the code in unsupported/Profile.st:
> 
> Bag subclass: IdentityBag [
>      dictionaryClass [ ^IdentityDictionary ]
> ]
> 
> BlockClosure extend [
> 
> profile [
>      | s profProcess workProcess results |
>      s := Semaphore new.
>      results := IdentityBag new.
>      workProcess := self newProcess.
>      profProcess := [
>          workProcess resume.
>          [
>              (Delay forMilliseconds: 5) wait.
>              workProcess isTerminated
>          ] whileFalse: [
>              results add: workProcess suspendedContext method.
>          ].
>          s signal
>      ] forkAt: Processor highIOPriority.
>      s wait.
>      ^results sortedByCount
> ] ]
> 
> [10000 factorial] profile do: [ :each|each printNl ]

Attachment: signature.asc
Description: Ceci est une partie de message numériquement signée


reply via email to

[Prev in Thread] Current Thread [Next in Thread]