Похожие чаты

Guys is copyOnwriteArrayList blocking or?

10 ответов

10 просмотров

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.

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

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

читать файл максимально быстро? странный вопрос))
zamtmn
50
Посоветуйте пожалуйста аудио плеер для библиотеки mp3- FLAC на компьютере. На Винде пользовался Aimp, в том числе для конвертации. Много нужных команд было прямо в контекст...
Виктор Кузнецов
31
It is definitely an interesting conversation. Breaking up the users into 2 personas: 1. Someone who wants to use the products (I want “x” pegged stablecoin that provides safe...
Bueno Pues
10
So, does this mean leap 6 is closed source now? https://github.com/AntelopeIO/spring/blob/main/LICENSE
Kameron James | zeos.one
20
Guys is any possible go up? Shib
Prem Kumar
21
всем привет! углубившись в плюсы и начав изучать реверсинг понял, что без асм'а никуда со своими высокоабстрактными представлениями начал изучать механизмы асма, и не совсем п...
9
Hello, are you guys developing on BCH? Building some side chain or something? Apps? Or do you guys have another vision for the project? That you don’t mind sharing
Jack
13
Ajeeb aadmi hai, isko padhna nahi aata kya?
Jay Bansal
43
буквально один оставшийся вопрос при выполнении строчки mov eax, 5 операнд "5" будет присутствовать где-либо в памяти (любой), кроме как в памяти блока .code? подвопрос: как...
12
Всем ку. Подскажите, если задекларировал массив так: int arr[10] = {1, 2, 3, 4}, то в arr[4] будет мусор или нуль?
Sasha K
14
Карта сайта