[Home] [Groups] - Message: [Prev in Group] [Next in Group]

nu.kanga.list.mud-dev

19064: Re: [MUD-Dev] Re: TECH: Distributed Muds

[Full Header] [Plain Text]
From: Chris Gray <cg@ami-cg.GraySage.COM>
Newsgroups: nu.kanga.list.mud-dev
Date: Fri, 27 Apr 2001 20:28:36 -0600
Organization: Kanga.Nu
> From: J C Lawrence <claw@2wire.com>

> There are three FIFOs (in, out, heap), so there are three mutexes.
> I handle these with counting semaphores.

OK, I grok. If you have a limit on the number of FIFO entries, or you
can handle the producer blocking, you can get rid of the mutexes using
the usual circular buffers, where the producer tests against the head
pointer and updates the tail pointer, and the consumer tests against
the tail pointer and updates the head pointer. I've used this sort of
thing in SMP environments, and its quite safe. You do have a limit on
the number of slots in your circular buffer, however.

--
Don't design inefficiency in - it'll happen in the implementation.

Chris Gray     cg@ami-cg.GraySage.COM
               http://www.GraySage.COM/cg/
_______________________________________________
MUD-Dev mailing list
MUD-Dev@kanga.nu
https://www.kanga.nu/lists/listinfo/mud-dev