TGTGInsighttelegram intelligenceLIVE / telegram public index
← Python Заметки

TGINSIGHT SIMILAR POSTS

Најди сличен содржај

Изворен канал @pythonotes · Post #269 · 7 јул.

­Возможно, стоит пояснить разницу между синхронизацией из thread/process-safe и синхронизацией с помощью Lock🤔 Наша задача — заставить разные процессы и потоки обращаться к базе данных (или любым другим ресурсам) последовательно. Чтобы не случилось так называемого race condition, то есть состояние гонки. Это когда разные потоки или процессы пытаются одновременно что-то сделать с одним и тем же ресурсом. В этом случае нам нужна какая-то логика ограничения. Пока один процесс не завершил своё действие, другие не могут получить доступ к ресурсу. Так вот, thread-safe и process-safe означает что отдельно взятые операции записи в БД гарантированно будут последовательны. Запросы из разных процессов или потоков выстроятся в очередь и не будут мешать друг другу. Лучше всего когда этот блок реализован на уровне БД в виде атомарных операций или ещё как-то. Но зачем нам тогда еще дополнительный Lock? Этот способ синхронизации используется когда процесс никак не укладывается в одно действие и должен сделать множество операций прежде чем дать доступ следующему. В этом случае процесс ставит некий глобальный Lock на ресурс и никто другой, даже получив законное право на доступ, не может ничего сделать. Все ждут пока этот Lock не будет снят. Это решается на уровне приложения и правильность реализации полностью в вашей ответственности. Например, если забыли разблокировать или сделали перекрёстный Lock (Deadlock как на картинке), то всё зависнет в бесконечном ожидании. #basic

Hashtags

Резултати

Пронајдени 1 слични објави

Пребарај: #splinternet

当前筛选 #splinternet清除筛选
Libreware

@libreware · Post #968 · 05.07.2021 г., 01:41

SplinterNet Android app designed to create an unblockable Twitter like network that uses no cellular or Internet communications. All messages are transmitted over Bluetooth between users, creating a true peer-to-peer messaging system. All messages are anonymous to prevent retaliation by government authorities. SplinterNet is a true peer-to-peer network in that it requires physical proximity to other people to transmit messages. In the current version this happens over a close range Bluetooth connection. To illustrate how SplinterNet works, here is an example scenario: You take a picture of a protest happening near your home. Fearing a spread of the protest the government shuts down cellular and Internet access to most citizens. You write a short message about the protest in SplinterNet and attach the picture. When you next meet with your friends, you sync SplinterNet with them. They now have your photo and will spread it to their friends. You also now have all their messages, which includes photos taken of protests happening in other parts of the country. Any person who can reach a working Internet connection can post all of these photos to any sharing service or send directly to journalists to publicize. If you fear capture, you can press a single button and all the messages in your copy of SplinterNet are deleted. Features Create a post with text and an optional single image. Mark posts as important to increase their spread within the network. These posts will be sent first during syncing and will be highlighted for the people you sync with. Delete posts to stop their spread. The contents of the network reflect what users of the network think is important and appropriate. You don't have to spread anything you don't want to. Project Status This is an experimental project still in development. All of the features listed here should work, they just haven't been tested in large networks. Please let us know how it works! https://raw.githubusercontent.com/megamattron/SplinterNet/master/other/splinterNet-infosheet.png https://github.com/megamattron/SplinterNet 📡@nogoolag📡@libreware #SplinterNet#im#messaging#p2p#bt#bluetooth