kotlin, is there a data structure like LinkedHashMap but thread safe

896 views Asked by At

Need to have a queue and like mapSet to having unique key, so that it supports

queue.put(key, value) //<== put in the queue and keep the order (it become last in the queue)
queue.get(key)
queue.remove(key)

and it can also do something like

queue.pop() // remove from head

seems it could be implemented with LinkedHashMap but it is not thread safe. Any other data structure in kotlin may be used for this case? or LruCache?

0

There are 0 answers