mike-jumper commented on PR #1136:
URL: 
https://github.com/apache/guacamole-client/pull/1136#issuecomment-3648386197

   No longer part of these changes, but an earlier iteration involved creating 
[a `ForkableHashMap` class that supports 
copy-on-write](https://github.com/mike-jumper/guacamole-client/blob/be53376f280cd646d096c67a6feb930b2bf56f01/guacamole/src/main/java/org/apache/guacamole/log/ForkableHashMap.java):
   
   ```java
   /**
    * HashMap implementation that uses copy-on-write to allow efficient cloning.
    * When an instance of ForkableHashMap has been copied using {@link #fork()},
    * the parent and child both continue to refer to the same copy of their
    * underlying data. If the parent (or child) is modified, only then does the
    * parent (or child) create an independent copy of that underlying data.
    * <p>
    * For simplicity, this implementation DOES NOT permit modification via the
    * collections/sets returned by {@link #values()}, {@link #keySet()}, or
    * {@link #entrySet()}.
    * <p>
    * As with the standard HashMap, this implementation IS NOT threadsafe.
    *
    * @param <K>
    *     The type of key used to store/retrieve values within this map.
    *
    * @param <V>
    *     The type of values stored by this map.
    */
   public class ForkableHashMap<K, V> implements Map<K, V> {
      ...
   }
   ```
   
   It was a neat data structure that lives on in the git history as part of 
commit be53376f280cd646d096c67a6feb930b2bf56f01 and might be handy in the 
future.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to