[Shootout-list] Haskell ring of messages - fair?
Bengt Kleberg
bengt.kleberg@ericsson.com
Thu, 23 Sep 2004 11:10:50 +0200
Einar Karttunen wrote:
> On 23.09 09:50, Bengt Kleberg wrote:
...deleted
>>could mvars be used to receive more than one message at the same time?
>
>
> well they have a buffer size of 1, and by default a synchronous send
> routine. That is send blocks if there is a queued item. Of course
> that may be exactly what one wants (to avoid killing consumers of
> data).
you are correct. that kind of behaviour is what we have the
producer/consumer test for, i think. correct me if i am wrong.
this is supposed to be another kind of test.
...deleted
>>would it be ok if i changed the test or is the installed base too big? :-)
>
>
> With just one entry...
>
i wanted to ask.
have you read about ''make''? somebody wanted to change the
error-creating syntax that the first character on a rule line had to be
a <tab> (ie, to allow other indention, like <space>). but since there
was 20 - 30 users of make the designer decided to be backwards
compatible. no change. lots of trouble for all users ever since.
i have made a change to the original message sending ring. i add the
sending of a low-priority message, together with the normal message.
this low priority message is ignored while the process is doing hard
work (defined as 10 recives of normal messages). after the hard work the
process will handle all the low prio messages, and then go back to hard
work again.
the test-if-sender-is-correct does not have to be done for low prio
messages.
does this test measure what i/we want? suggestions, improvments?
note: i have not seen an answer to my question if we really need a
variable amount of processes. anybody that would care to comment on that?
bengt