|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Re: framework 1.1 & Queue classOn Apr 24, 5:35 am, Rory Becker <RoryBec...@newsgroup.nospam> wrote:
> I would like to tak an extra question on to this one. Yes, it works in a similar fashion.> > I am interested in using a HashTable in a similar fashion. > > I was wondering is the "local sychronized wrapper" technique applicable here? > > Likewise will using this synchronised object ensure that I am thread safe Yes. However, the Hashtable was designed to be partially thread-safe> with regard to my HashTable/Queue? even without the synchronized wrapper. It is safe to have multiple readers as long as there is only one writer. You might be able to use that to your advantage.
Show quote
> On Apr 24, 5:35 am, Rory Becker <RoryBec...@newsgroup.nospam> wrote: Excellent Brian.> >> I would like to tak an extra question on to this one. >> >> I am interested in using a HashTable in a similar fashion. >> >> I was wondering is the "local sychronized wrapper" technique >> applicable here? >> > Yes, it works in a similar fashion. > >> Likewise will using this synchronised object ensure that I am thread >> safe with regard to my HashTable/Queue? >> > Yes. However, the Hashtable was designed to be partially thread-safe > even without the synchronized wrapper. It is safe to have multiple > readers as long as there is only one writer. You might be able to use > that to your advantage. Thanks for pointing out this benifit. This point will prove very useful -- Rory |
|||||||||||||||||||||||