Are indexes built CONCURRENTLY different in any way?

Advertisements Does PostgreSQL CREATE INDEX CONCURRENTLY mean that even after initial index build, new and future inserts won’t be indexed immediately (strongly consistent in terms of indexing)? >Solution : No. CREATE INDEX with the modifier CONCURRENTLY produces exactly the same kind of index as without the modifier. CONCURRENTLY only changes the way the index is… Read More Are indexes built CONCURRENTLY different in any way?

Java unexpected concurrent result

Advertisements While testing concurrency, I found something unexpected. Concurrency was controlled using concurrentHashMap and AtomicLong. public class HumanRepository { private final static Map<Long, Human> STORE = new ConcurrentHashMap<>(); private AtomicLong sequence = new AtomicLong(); public void save(Human human) { STORE.put(sequence.incrementAndGet(), human); } public int size() { return STORE.size(); } public Long getSeq() { return sequence.get();… Read More Java unexpected concurrent result

Can multiple threads add items to Concurrent collections EXACTLY at the same time?

Advertisements I am trying to figure out concurrent collections in C#. ConcurrentBag, ConcurrentDictionary and ConcurrentQueue. Is it possible for multiple threads to add items to them EXACTLY at the same time? Or they wait one after the other? I tried to examine their source code, but I really couldn’t tell for sure. I see here… Read More Can multiple threads add items to Concurrent collections EXACTLY at the same time?