Tag: lock
-
Post Views: 66 In the previous Go concurrency review, I focused on the many drawbacks of ‘global variable lock synchronization’ through factorial cases, especially the core question of ‘there are still hidden dangers when adding locks and hibernation’ Question – Manually set the sleep time to accurately match the rhythm of the execution of the protocol. If the resource is…
-
Post Views: 94 In Go language concurrent programming, goroutine is the core of efficient concurrency, but the communication and synchronization between multiple goroutines is often a place for beginners to easily step on pits. This article will take ‘calculate the factorials of 1-200 and store them into Map’ as a case, and combine the problems encountered in the learning process,…
-
Post Views: 18 1. Reference URL:https://www.shuijingwanwq.com/2017/01/08/1505/, the process of realizing the locking mechanism of Redis under Yii2.0, its core is to use Redis SetNX. 2. Generally speaking, after the lock is successful, the corresponding business logic is executed, and then the lock is deleted. However, if the business logic is accidentally exited for some reason, resulting in a lock but…
-
Post Views: 13 1. The request interface, the total number of resources in the response parameters is 30. Resources containing ids equal to 37918 are duplicates. A total of 2. as shown in Figure 1 2. Check the model class, /common/models/redis/cmc_console/user.php 3. Check /common/components/redis/activerecord.php , which defines the prefix and applies to all AR keys. 4. Open RedisDesktopManager, check the…
-
Post Views: 17 1. Docker deployment, the implementation of Crontab (Bash Sleep) based on Supervisor, to reduce memory usage, refer to:https://www.shuijingwanwq.com/2019/10/12/3555/. /console/controllers/cmcConsoleUserController.php 2. Break ends the execution of the current Foreach structure, that is, each run of the command line, only the user list under the tenant is successfully synchronized. When there are too many tenants, suppose 100 tenants, the…
-
Post Views: 18 1. Set the lockout time: the current UNIX timestamp + Redis lock timeout time, in seconds (3), edit the file: \common\config\params.php, as shown in Figure 1 2. Get the relevant setting parameters and edit the file: \api\models\redis\gamecategory.php, as shown in Figure 2 3. Get the Redis connection to execute the relevant commands, edit the file: \API\Models\Redis\GameCategory.php, as…