Re: How would you store read/unread topic status?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 23 Jun 2009, Nikolas Everett wrote:
If you happen to be using Java, HashMap and TreeMap are perfect for this because they are reentrant so you don't have to worry about synchronizing your sweeper with your web page activities.

See the note in http://java.sun.com/javase/6/docs/api/java/util/TreeMap.html

"Note that this implementation is not synchronized."

If you have multiple threads accessing a TreeMap or HashMap, then they must be synchronised to ensure that only one thread at a time is accessing it. Otherwise, you may suffer severe data loss and possibly even JVM crashes. Perhaps you meant java.util.concurrent.ConcurrentHashMap?

Be very careful.

Matthew

--
Now, you would have thought these coefficients would be integers, given that
we're working out integer results. Using a fraction would seem really
stupid. Well, I'm quite willing to be stupid here - in fact, I'm going to
use complex numbers.                    -- Computer Science Lecturer

--
Sent via pgsql-performance mailing list (pgsql-performance@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-performance

[Postgresql General]     [Postgresql PHP]     [PHP Users]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Yosemite]

  Powered by Linux