java - How do copy on write collections provide thread-safety? -


this question has answer here:

how copy on write collections provide thread-safety , in scenarios useful implement?

the way make brand new copy of list every time altered.

reads not block, , pay cost of volatile read. writes not block reads (or vice versa), 1 write can occur @ once.


Comments

Popular posts from this blog

java - Date formats difference between yyyy-MM-dd'T'HH:mm:ss and yyyy-MM-dd'T'HH:mm:ssXXX -

c# - Get rid of xmlns attribute when adding node to existing xml -