activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James Strachan" <james.strac...@gmail.com>
Subject Re: Using ActiveMQ from .NET compact framework
Date Tue, 10 Oct 2006 16:50:56 GMT
On 10/10/06, Oleg Deribas <thisaddressisnotmine@td.selfip.net> wrote:
> Hello,
>
> James Strachan said the following on 10.10.2006 15:38:
>
> >> It seems that this mailing list doesn't accept attachments... :-(
> >
> > yeah - though you can attach stuff to the website wiki or JIRA
>
> Should I create issue regarding compact framework compatibility in jira?

Yes please


>
> >> >> with activemq project - it uses Monitor.PulseAll and Monitor.Wait
> >> >> methods not supported by compact framework. I'll try to investigate
if
> >> >> it is possible to avoid these methods usage.
> >> >
> >> > I wonder if there's an alternative way of doing these kinds of
> >> > monitors / semaphores in .Net?
> >>
> >> Yes. Possibly it could be done just with plain locks. I'm currently
> >> trying to do so.
> >
> > Note that we use lock a fair bit, we're using Monitor for inter-thread
> > notifications rather than mutually exclusive locking. Or idd I
> > misunderstand you there?
>
> I think it is possible to replace Monitor.Wait(semaphore, maxWait) with:
>
> Monitor.Exit(semaphore);
> autoResetEvent.WaitOne(maxWait, false);
> Monitor.Enter(semaphore);
>
> and Monitor.PulseAll(semaphore) with:
>
> Monitor.Exit(semaphore);
> autoResetEvent.Set();
> Monitor.Enter(semaphore);
>
> but maybe, class which uses AutoResetEvent should implement IDisposable
> interface and call autoResetEvent.Close() in Dispose method.

Great thanks!

-- 

James
-------
http://radio.weblogs.com/0112098/

Mime
View raw message