Похожие чаты

Guys is copyOnwriteArrayList blocking or?

10 ответов

19 просмотров

you mean thread safe?

skittles- Автор вопроса

Its just regular ArrayList but thread safe

Yes, it's blocking. Blocks on all writes. And I found that out by just looking at the code. I don't know any other way to find it out if that is not specified in the docs.

skittles- Автор вопроса
Nader Jafari
Its just regular ArrayList but thread safe

If only that "but thread safe" was a simple annotation you put on a class, and boom - it magically becomes thread safe))) But it's not. And the main part of the story is that there many different ways to make it thread safe. CopyOnWrite principle is one of such ways, but it's not the only one. And it works differently from let's say Collections.SynchronizedList.

skittles
lol you took liberty to look at the code XD

I have my IDE in front of me, and giving it a glance is even faster than writing you back))

skittles- Автор вопроса
Dmytro Buryak
If only that "but thread safe" was a simple annota...

btw i am read it somewhere that it does not blocks

Dmytro Buryak
If only that "but thread safe" was a simple annota...

doesnt change the fact that is ArrayList but thread safe

Nader Jafari
doesnt change the fact that is ArrayList but thre...

Right. You can say the same that Collections.SynchronizedMap and ConcurrentHashMap are both maps but thread safe. Both designed to be thread safe. But they behave very differently in terms of performance and some specific behavior when you use them. And that's exactly what original question was about. It was not whether it's thread safe or not. But it was about how it behaves.

Похожие вопросы

Обсуждают сегодня

Господа, а что сейчас вообще с рынком труда на делфи происходит? Какова ситуация?
Rꙮman Yankꙮvsky
29
А вообще, что может смущать в самой Julia - бы сказал, что нет единого стандартного подхода по многим моментам, поэтому многое выглядит как "хаки" и произвол. Короче говоря, с...
Viktor G.
2
@Benzenoid can you tell me the easiest, and safest way to bu.y HEX now?
Živa Žena
20
This is a question from my wife who make a fortune with memes 😂😂 About the Migration and Tokens: 1. How will the old tokens be migrated to the new $LGCYX network? What is th...
🍿 °anton°
2
30500 за редактор? )
Владимир
47
а через ESC-код ?
Alexey Kulakov
29
What is the Dex situation? Agora team started with the Pnetwork for their dex which helped them both with integration. It’s completed but as you can see from the Pnetwork ann...
Ben
1
Гайс, вопрос для разносторонее развитых: читаю стрим с юарта, нада выделять с него фреймы с определенной структурой, если ли чо готовое, или долбаться с ринг буффером? нада у...
Vitaly
9
Anyone knows where there are some instructions or discort about failed bridge transactions ?
Jochem
21
@lozuk how do I get my phex copies of my ehex from a atomic wallet, to move to my rabby?
Justfrontin 👀
11
Карта сайта