Возможно, стоит пояснить разницу между синхронизацией из thread/process-safe и синхронизацией с помощью Lock🤔
Наша задача — заставить разные процессы и потоки обращаться к базе данных (или любым другим ресурсам) последовательно. Чтобы не случилось так называемого race condition, то есть состояние гонки. Это когда разные потоки или процессы пытаются одновременно что-то сделать с одним и тем же ресурсом.
В этом случае нам нужна какая-то логика ограничения. Пока один процесс не завершил своё действие, другие не могут получить доступ к ресурсу.
Так вот, thread-safe и process-safe означает что отдельно взятые операции записи в БД гарантированно будут последовательны. Запросы из разных процессов или потоков выстроятся в очередь и не будут мешать друг другу. Лучше всего когда этот блок реализован на уровне БД в виде атомарных операций или ещё как-то.
Но зачем нам тогда еще дополнительный Lock?
Этот способ синхронизации используется когда процесс никак не укладывается в одно действие и должен сделать множество операций прежде чем дать доступ следующему. В этом случае процесс ставит некий глобальный Lock на ресурс и никто другой, даже получив законное право на доступ, не может ничего сделать. Все ждут пока этот Lock не будет снят.
Это решается на уровне приложения и правильность реализации полностью в вашей ответственности. Например, если забыли разблокировать или сделали перекрёстный Lock (Deadlock как на картинке), то всё зависнет в бесконечном ожидании.
#basic
To the beautiful and wonderful BeforeCoinMarketCap Community!
Sincerest wishes for health, happiness, and peace during this Holidays season and throughout the coming year! We thank you all for your unlimited contribution. We hope you stay with us, there are many interesting things this coming year!
Let the spirit of love gently fill our hearts and homes. In this loveliest of seasons may you find many reasons for happiness.
From all of us at BeforeCoinMarketCap. 💝
#BCMC1#BeforeCoinMarketCap#Crypto#BCMCToken#Airdrop#Bounty
Dear community! 💙
BCMC1 People IEO Airdrop⬇️⬇️⬇️
@bcmc_peopleIEO_airdropbot
✅ Please complete all the tasks and submit details correctly.
💰 Rewards:
- If you complete all tasks you will get 450 BCMC1.
📊Market: CoinMarketCap
💧BOUNTY💧
⏰ Airdrop will end on (UTC) or when there are 5,000 participants.
#BCMC1#BeforeCoinMarketCap#BCMC#Crypto#BCMCToken#Airdrop
🚀BeforeCoinMarketCap NEW AIRDROP🚀
💵Total Reward: 550 BCMC1
💰 Value: $8
📊Market: CoinMarketCap
click here⤵️
💎Airdrop Bot💎
☝️Don't miss out on MLM (Ongoing tokens sale with limited pool).
🥳 Invite buyers with your referral links and earn 10%
GOOD LUCK TO EVERYONE!!!✊🏻
💠Telegram
💠Telegram Channel
💠Twitter
💠Facebook
💠LinkedIn
💠YouTube
💠Website
#BCMC1#BeforeCoinMarketCap#BCMC#Crypto#BCMCToken#Airdrop
💧BeforeCoinMarketCap BOUNTY💧
(For 100 participants only💯)
Make a video about our platform: Post it on your official YouTube channel (3-5 minutes) $50 - $100 in BCMC1 token. We take into account the length and quality of the content.
Example: Please watch this videos for instructions: https://youtu.be/8t1ucZFnyL8 & https://youtu.be/aYrpgGpI074
1 Best video will receive 15,000BCMC1 ($200) and will posted on our social channels.🏆
Mandatory:
✅Describe the People IEO. (Community voting)
✅Describe the People IEO. (Participant projects)
✅Explain the MLM system (Ongoing token sales)
❗️Notice: The channel must have Minimum of 1000 subscribers. Your email will be blacklisted if you submit an old video link or if you do not follow the instructions given.
#BCMC1#BeforeCoinMarketCap#BCMC#Crypto#BCMCToken#bounty#Bounty
💎 BeforeCoinMarketCap New BOUNTY 💎
For 100 participants only💯
Bounty Tasks✅
Make a video about our platform: Post it on your official YouTube channel (3-5 minutes) $50 - $100 in BCMC1 token. We take into account the length and quality of the content.
📍Mandatory:
1. Describe the search window.
2. Describe the Announcement window
3. Explain the MLM system (Ongoing token sales):
4. Describe the promotion website
Best video will receive 20,000BCMC1 ($300) and will posted on our social channels.
📍Bounty Google Form
Notice: The channel must have Minimum of 1000 subscribers. Your email will be blacklisted if you submit an old video link or if you do not follow the instructions given.
#BCMC1#BeforeCoinMarketCap#BCMC#Crypto#BCMCToken#Bounty