MUD-Dev
mailing list archive
[ Other Periods
| Other mailing lists
| Search
]
Date:
[ Previous
| Next
]
Thread:
[ Previous
| Next
]
Index:
[ Author
| Date
| Thread
]
[MUD-Dev] Re: lurker emerges
T. Alexander Popiel wrote:
[skipped]
> Unfortunately, I require (by my own free will, I'll admit) functionality
> in non-threaded environments, so the portability doesn't hold for me.
> However, we're just getting religious here, so I'll drop it. ;-)
My fault - I'm getting picky with the *terms* to achieve the
understanding, and usually forget to mention that upfront.
> >nor Java semaphores (they don't exist there)
>
> *blink blink*
>
> I suppose not, in the strictest sense, but I use the following
> construct all the time:
>
> Object sem = new Object();
> synchronized (sem) {
> /* pass sem to some other thread */
> sem.wait();
> }
>
> ...
>
> /* some other thread */
> synchronized (sem) { sem.notify(); }
>
> Tastes like a semaphore to me. ;-)
Looks like duck... :-)) In fact, yes, this is a mutex semaphore. As for
event semaphores, it's slightly different, and I had my own ideas about
the semantics, so I've implemented the sems in a pretty weird way.
One of the goals I wanted to achieve is to create a multiple-wait
semaphore, or semaphore group. It is possible to do this stuff in Java
without any additions, too, but it's the pain in the neck. And, as a
side effect, the observable/observer pattern applies here well, too. And
the callbacks.
And as it turned out, it was useful to implement even the mutex
semaphores (though they _do_ exist as the synchronized access) just to
make the design concept clearer. And to use them in the multiple-wait
conditions.
> - Alex
--
Still alive and smile stays on,
Vadim Tkachenko <vt#freehold,crocodile.org>
--
UNIX _is_ user friendly, he's just very picky about who his friends are
- Thread context:
- [MUD-Dev] Re: lurker emerges, (continued)
- [MUD-Dev] Re: lurker emerges,
Vadim Tkachenko vt#freehold,crocodile.org, Tue 11 Aug 1998, 03:41 GMT
- [MUD-Dev] Re: lurker emerges,
T. Alexander Popiel popiel#snugharbor,com, Tue 11 Aug 1998, 04:45 GMT
- [MUD-Dev] Re: lurker emerges,
Vadim Tkachenko vt#freehold,crocodile.org, Tue 11 Aug 1998, 05:39 GMT
- [MUD-Dev] Re: lurker emerges,
T. Alexander Popiel popiel#snugharbor,com, Tue 11 Aug 1998, 15:05 GMT
- [MUD-Dev] Re: lurker emerges,
Vadim Tkachenko vt#freehold,crocodile.org, Wed 12 Aug 1998, 04:33 GMT
- [MUD-Dev] Re: lurker emerges,
Petri Virkkula pvirkkul#iki,fi, Tue 11 Aug 1998, 07:53 GMT
- [MUD-Dev] Re: lurker emerges,
Vadim Tkachenko vt#freehold,crocodile.org, Tue 11 Aug 1998, 06:48 GMT
[MUD-Dev] Re: lurker emerges,
Petri Virkkula pvirkkul#iki,fi, Mon 10 Aug 1998, 05:57 GMT
[MUD-Dev] Re: lurker emerges,
James Wilson jwilson#rochester,rr.com, Sun 09 Aug 1998, 23:54 GMT
[ Other Periods
| Other mailing lists
| Search
]