[Haskell-cafe] Re: TChan implementation: Why TVarList

Simon Peyton-Jones simonpj at microsoft.com
Tue Dec 6 07:35:23 EST 2005


sounds as if you need a priority queue, so you can say "give me the
message with the earliest time" but otherwise yes.

Simon

| -----Original Message-----
| From: haskell-cafe-bounces at haskell.org
[mailto:haskell-cafe-bounces at haskell.org] On Behalf Of Joel
| Reymont
| Sent: 06 December 2005 11:46
| To: Simon Peyton-Jones
| Cc: Haskell Cafe
| Subject: [Haskell-cafe] Re: TChan implementation: Why TVarList
| 
| Well, I meant more like TVar [a] but I see that you are pulling from
| the front and appending to the rear.
| 
| I need to implement a mailbox where messages can be pulled out based
| on a predicate or in order of arrival. I'm thinking of using a Map
| keyed on ClockTime.
| 
| Do you have any suggestions?
| 
| 	Thanks, Joel
| 
| On Dec 6, 2005, at 11:31 AM, Simon Peyton-Jones wrote:
| 
| > The mutable cell is in the tail.  A [TVar a] would be quite
different.
| > You can read about a very similar impl (based on MVars) in the
| > original
| > "Concurrent Haskell" paper (on my papers page)
| 
| --
| http://wagerlabs.com/
| 
| 
| 
| 
| 
| _______________________________________________
| Haskell-Cafe mailing list
| Haskell-Cafe at haskell.org
| http://www.haskell.org/mailman/listinfo/haskell-cafe


More information about the Haskell-Cafe mailing list