Возможно, стоит пояснить разницу между синхронизацией из thread/process-safe и синхронизацией с помощью Lock🤔
Наша задача — заставить разные процессы и потоки обращаться к базе данных (или любым другим ресурсам) последовательно. Чтобы не случилось так называемого race condition, то есть состояние гонки. Это когда разные потоки или процессы пытаются одновременно что-то сделать с одним и тем же ресурсом.
В этом случае нам нужна какая-то логика ограничения. Пока один процесс не завершил своё действие, другие не могут получить доступ к ресурсу.
Так вот, thread-safe и process-safe означает что отдельно взятые операции записи в БД гарантированно будут последовательны. Запросы из разных процессов или потоков выстроятся в очередь и не будут мешать друг другу. Лучше всего когда этот блок реализован на уровне БД в виде атомарных операций или ещё как-то.
Но зачем нам тогда еще дополнительный Lock?
Этот способ синхронизации используется когда процесс никак не укладывается в одно действие и должен сделать множество операций прежде чем дать доступ следующему. В этом случае процесс ставит некий глобальный Lock на ресурс и никто другой, даже получив законное право на доступ, не может ничего сделать. Все ждут пока этот Lock не будет снят.
Это решается на уровне приложения и правильность реализации полностью в вашей ответственности. Например, если забыли разблокировать или сделали перекрёстный Lock (Deadlock как на картинке), то всё зависнет в бесконечном ожидании.
#basic
Channel: Best Forex Indicators and robots for MT4/MT5. Dolphintrader.com.
Members: ~2.62K
💢 Username: @dolphintraders
Description:
Forex indicators, robots and trading systems for Metatrader 4 and MT5
🏷 Tags: #crypto_fx_trading
#forex#mt4#mt5#indicators#signals
https://telegramchannels.me/channels/dolphintraders
⚙100% NON-REPAINT. 0% GUESSING.⚙
👉Look at these clean entries from today's session with Pro Thunder V12. Once the signal appears, it STAYS. No shifting, no disappearing, just pure accuracy.
👉Neural Network Logic: Our AI scans thousands of data points to find the highest probability reversal.
📈Result: See the screenshots for the clinical precision.
Stop losing money on lagging indicators. It’s time to upgrade to the V12 standard.👑
👇 GET YOUR COPY NOW 👇
👉CLICK TO GET V12 NOW!
#MT5#Indicator#binaryindicator#pocketoption#quotex#бинарныеопционы#бинарныеопционы
⚙100% NON-REPAINT. 0% GUESSING.⚙
👉Look at these clean entries from today's session with Pro Thunder V12. Once the signal appears, it STAYS. No shifting, no disappearing, just pure accuracy.
👉Neural Network Logic: Our AI scans thousands of data points to find the highest probability reversal.
📈Result: See the screenshots for the clinical precision.
Stop losing money on lagging indicators. It’s time to upgrade to the V12 standard.👑
👇 GET YOUR COPY NOW 👇
👉CLICK TO GET V12 NOW!
#MT5#Indicator#binaryindicator#pocketoption#quotex#бинарныеопционы#бинарныеопционы
⚙100% NON-REPAINT. 0% GUESSING.⚙
👉Look at these clean entries from today's session with Pro Thunder V12. Once the signal appears, it STAYS. No shifting, no disappearing, just pure accuracy.
👉Neural Network Logic: Our AI scans thousands of data points to find the highest probability reversal.
📈Result: See the screenshots for the clinical precision.
Stop losing money on lagging indicators. It’s time to upgrade to the V12 standard.👑
👇 GET YOUR COPY NOW 👇
👉CLICK TO GET V12 NOW!
#MT5#Indicator#binaryindicator#pocketoption#quotex#бинарныеопционы#бинарныеопционы
🤍Pro Thunder V12 Always working Accurately till Then Market closing with Precision! Even Market is Volatile or Not, Its Make Dominance Always!🧿
#MT5#Indicator#binaryindicator#pocketoption#quotex#бинарныеопционы#бинарныеопционы
⚙100% NON-REPAINT. 0% GUESSING.⚙
👉Look at these clean entries from today's session with Pro Thunder V12. Once the signal appears, it STAYS. No shifting, no disappearing, just pure accuracy.
👉Neural Network Logic: Our AI scans thousands of data points to find the highest probability reversal.
📈Result: See the screenshots for the clinical precision.
Stop losing money on lagging indicators. It’s time to upgrade to the V12 standard.👑
👇 GET YOUR COPY NOW 👇
👉CLICK TO GET V12 NOW!
#MT5#Indicator#binaryindicator#pocketoption#quotex#бинарныеопционы#бинарныеопционы
⚙100% NON-REPAINT. 0% GUESSING.⚙
👉Look at these clean entries from today's session with Pro Thunder V12. Once the signal appears, it STAYS. No shifting, no disappearing, just pure accuracy.
👉Neural Network Logic: Our AI scans thousands of data points to find the highest probability reversal.
📈Result: See the screenshots for the clinical precision.
Stop losing money on lagging indicators. It’s time to upgrade to the V12 standard.👑
👇 GET YOUR COPY NOW 👇
👉CLICK TO GET V12 NOW!
#binarytrading#pocketoption#quotex#pocketoptionindicator#quotexindicator#indicator#tradingindicator#ss7trader#MT5#Indicators#binaryindicator#бинарныеопционы#бинарныеопционы#nonrepaintindicator#highaccuracyindicator#binarytrading#pocketoption#quotex#pocketoptionindicator#quotexindicator#indicator#tradingindicator#ss7trader
Next-gen Neural Network Indicator for Binary Trading. Non-repaint signals with 80%+ accuracy. 120-150+ setups daily. Works across all platforms including Pocket Option & Quotex. High-performance trading starts here.
#binarytrading#pocketoption#quotex#pocketoptionindicator#quotexindicator#indicator#tradingindicator#ss7trader#MT5#Indicators#binaryindicator#бинарныеопционы#бинарныеопционы#nonrepaintindicator#highaccuracyindicator#binarytrading#pocketoption#quotex#pocketoptionindicator#quotexindicator#indicator#tradingindicator#ss7trader