{"push_id":1809667032,"size":1,"distinct_size":1,"ref":"refs/heads/java-cache","head":"3d4ac3c23d50fa368ae58b026834c2f89675626e","before":"9091c138e198eddbc94692eafe3afb4c315bb22f","commits":[{"sha":"3d4ac3c23d50fa368ae58b026834c2f89675626e","author":{"name":"Jeremy Audet","email":"5797ac6b7c048edc0be118a71505136650e08df0@gmail.com"},"message":"Java: Add two cache classes\n\nImplement several caches that can store key-value pairs and create soft\nreferences to the values. The caches can optionally hold a limited\nnumber of key-value pairs and are thread safe.\n\nThe implementation in the `cache` directory makes use of the\n`synchronized` keyword, and the implementation in the\n`concurrent-read-cache` directory makes use of a read-write lock.  While\nI haven't done performance benchmarking, I expect the former\nimplementation to make more intelligent caching decisions, and I expect\nthe latter implementation to have higher performance in read-heavy\nmulti-threaded applications.\n\nThe heavy use of the `synchronized` keyword on the former implementation\nmay seem like overkill. however, its' necessary. From the `HashMap`\ndocumentation:\n\n     If multiple threads access a hash map concurrently, and at least\n     one of the threads modifies the map structurally, it must be\n     synchronized externally.  (A structural modification is any\n     operation that adds or deletes one or more mappings; merely\n     changing the value associated with a key that an instance already\n     contains is not a structural modification.)\n\nDepending on the exact use case, users of both types of cache objects\nmight still need to use the `synchronized` and `volatile` keywords.  The\nformer is useful in situations where a read from the cache affects a\nsubsequent write, and the latter is useful any time one thread reads\nfrom the cache, a second thread writes to the cache, and the first\nthread reads from the cache again.","distinct":true,"url":"https://api.github.com/repos/Ichimonji10/impedimenta/commits/3d4ac3c23d50fa368ae58b026834c2f89675626e"}]}
{"actor":{"display_login":"Ichimonji10"}}