Возможно, стоит пояснить разницу между синхронизацией из thread/process-safe и синхронизацией с помощью Lock🤔
Наша задача — заставить разные процессы и потоки обращаться к базе данных (или любым другим ресурсам) последовательно. Чтобы не случилось так называемого race condition, то есть состояние гонки. Это когда разные потоки или процессы пытаются одновременно что-то сделать с одним и тем же ресурсом.
В этом случае нам нужна какая-то логика ограничения. Пока один процесс не завершил своё действие, другие не могут получить доступ к ресурсу.
Так вот, thread-safe и process-safe означает что отдельно взятые операции записи в БД гарантированно будут последовательны. Запросы из разных процессов или потоков выстроятся в очередь и не будут мешать друг другу. Лучше всего когда этот блок реализован на уровне БД в виде атомарных операций или ещё как-то.
Но зачем нам тогда еще дополнительный Lock?
Этот способ синхронизации используется когда процесс никак не укладывается в одно действие и должен сделать множество операций прежде чем дать доступ следующему. В этом случае процесс ставит некий глобальный Lock на ресурс и никто другой, даже получив законное право на доступ, не может ничего сделать. Все ждут пока этот Lock не будет снят.
Это решается на уровне приложения и правильность реализации полностью в вашей ответственности. Например, если забыли разблокировать или сделали перекрёстный Lock (Deadlock как на картинке), то всё зависнет в бесконечном ожидании.
#basic
werewolf garink
Grub werewolf yg garink. kalo mau main werewolf dengan sensasi yg garink dan biasa aja.
yang di daerah jakarta kadang werewolfgarink juga main offline. yuk gabung.!!
📍@werewolfgarink
#Indonesia#Jakarta
WerewolfUIN
Nyari keseruan? Yuk gabung aja di werewolfUIN, Buat mahasiswa UIN, Alumni atau Umum yg nyari tempat buat main werewolf yg asik, disini tempatnya! Yuk gabung ditunggu ya!
📍@werewolfUIN
#Indonesia#UIN#Jakarta
🇮🇩Jakarta will build an F1 track, a theme park and a new port
📰 One of the richest men in Indonesia, Sugianto Kusuma, is developing the PIK 2 city project in the north of Jakarta. The cost of the project is estimated at $16.5 billion. According to plans, the development will be complemented by Indonesia's first F1 track, a theme park and a seaport.
🏎 A few years ago in Bali already announced the construction of a theme park Paramount and Formula 1 track in the area of Jembran. But the work never started.
🏗 It is only good news about the new project PIK 2 as soon as the developers have a long-term vision and everything is going well with financing.
@BaliNews
#projects#business#Jakarta
🏗Trump's project is stopped due to violations of environmental regulations
📰Bloomberg reports that the construction of a luxury Trump-branded golf resort owned by current US President Donald Trump has been suspended. Authorities accuse the developer of violating environmental regulations.
💬Indonesia's Environment Ministry issued a statement saying that the project of golf courses and branded residences 60 kilometers from Indonesia's capital Jakarta violates water drainage rules. The project is being developed by a development company owned by one of Indonesia's richest men, media tycoon Hary Tanoesoedibjo.
@BaliNews
#realestate#projects#Jakarta
🎸Linkin Park will perform in Jakarta in early 2025
🎤 Linkin Park, the iconic alternative rock band, has finally started touring again. In 2024, after finally recovering from the loss of Chester Bennington, the band has added vocalist Emily Arsmstrong to their lineup.
📍Jakarta is the only city in Southeast Asia that the legendary band will visit.
📆 The concert will take place on February 16, 2025, Indonesia will be the fourth country the band will visit since the beginning of the tour, right after Brazil, Saudi Arabia, Mexico and Japan.
🎫Tickets for the show will be available from November 18 on the official website. Which venue Linkin park will perform at is not yet known. Keep an eye on the information as the best tickets for such concerts are sold out very quickly.
@BaliNews
#events#concerts#wheretogo#Jakarta