Возможно, стоит пояснить разницу между синхронизацией из thread/process-safe и синхронизацией с помощью Lock🤔
Наша задача — заставить разные процессы и потоки обращаться к базе данных (или любым другим ресурсам) последовательно. Чтобы не случилось так называемого race condition, то есть состояние гонки. Это когда разные потоки или процессы пытаются одновременно что-то сделать с одним и тем же ресурсом.
В этом случае нам нужна какая-то логика ограничения. Пока один процесс не завершил своё действие, другие не могут получить доступ к ресурсу.
Так вот, thread-safe и process-safe означает что отдельно взятые операции записи в БД гарантированно будут последовательны. Запросы из разных процессов или потоков выстроятся в очередь и не будут мешать друг другу. Лучше всего когда этот блок реализован на уровне БД в виде атомарных операций или ещё как-то.
Но зачем нам тогда еще дополнительный Lock?
Этот способ синхронизации используется когда процесс никак не укладывается в одно действие и должен сделать множество операций прежде чем дать доступ следующему. В этом случае процесс ставит некий глобальный Lock на ресурс и никто другой, даже получив законное право на доступ, не может ничего сделать. Все ждут пока этот Lock не будет снят.
Это решается на уровне приложения и правильность реализации полностью в вашей ответственности. Например, если забыли разблокировать или сделали перекрёстный Lock (Deadlock как на картинке), то всё зависнет в бесконечном ожидании.
#basic
#PAWS Solana OG Allocation
If you have an active Solana wallet, check if you’ve received an airdrop or not.
Here's the full list of the 13 projects in the Solana OG Allocation:
Memecoins:
DogWifHat ($WIF) -
Bonk ($BONK)
Pudgy Penguins ($PENGU)
STONKS ($STNK)
GigaChad ($GIGA)
Eliza ($Ai16z)
DeFi:
Magic Eden ($ME)
Phantom Wallet
Jupiter ($JUP)
Raydium ($RAY)
Solana Phone
Jito ($JTO)
Mad Lads by Backpack
Paws Airdrop Checker: https://paws.community/app/solana-og
#PAWS
The airdrop criteria have appeared on the PAWS website !!
➡Open the PAWS app
➡Tap "Check Eligibility"
➡See if you qualify for the airdrop!
Are you Eligible?
🗿 Yes
😢 No
New Task added in @Paws
Get 5000 Paws by completing this task
👉
Big #PAWS Sighted In These Area! 🐶
New task just dropped.
Put 🐾 in your name and stay on marked trails!
👉 PLAY PAWS : CLICK
#Paws Bot is Verified !!
Just a few days ago, the @PAWS bot launched and within less then 3 days it reached a massive milestone of 10 million users! 🤯 And now, it's officially verified by Telegram! 🎉
👉PLAY : @PAWS
💎PAWS ONE LAST RIDE 💎
The final mandatory check is live!
Only those who finish it will stay in.
Go to PAWS Web & check it off.
P.S. Special roles for holding 10+ Vouchers are now available in PAWS Discord!🐾
#PAWS HIGHER 🐶
💎PAWS ONE LAST RIDE 💎
The final mandatory check is live!
Only those who finish it will stay in.
Go to PAWS Web & check it off.
P.S. Special roles for holding 10+ Vouchers are now available in PAWS Discord!🐾
#PAWS HIGHER 🐶
🔤🔤🔤🔤
Do you like detective stories and puzzles?
Let us analyze the picture and say what can you see and predict for the upcoming listing and TGE?
#Paws
#paws
🐾PAWS 18,000,000 million participants
🔥The project is gaining momentum, the next trail according to the hint in the video is the X Empire project, they should still drop coins for it💎
💵Easy money 10-50$, without doing anything
@PAWS
--------------------------------------------------
🤘Blums code
🗣#PAWS – Upcoming Airdrop for Solana DeFi Users
PAWS has announced an upcoming airdrop, rewarding everyone who has used DeFi on Solana!
🔗Post
💡 What to Expect:
🟠 Rewards for Jupiter swaps
🟠 Perks for NFT purchases on Magic Eden
🟠 Bonuses for using Phantom Wallet
⏳ Now is the time to prepare your accounts for the drop!
☝️ Start trading on Bybit
Crypto Drop Club 👉 SUBSCRIBE