Closed gcmartin closed 5 years ago
@gcmartin New programming model coroutine
became the mainstream, people are able to build concurrent logics easily within a single process with coroutine. Any reason why you like to sync between multiple processes?
To share data between Swoole Websocket Server workers, for instance to cache data and to store/update user-related information faster than relying on external in-memory databases like Memcached/Redis.
I was just about to use the Swoole lock. :(
Why is it being removed?
How do you find that sort of news?
Deadlocks can occur when using locks in coroutines
$lock = new Swoole\Lock();
$c = 2;
while ($c--) {
go(function () use ($lock) {
$lock->lock();
Co::sleep(1);
$lock->unlock();
});
}
Deadlocks can occur when using locks in coroutines
$lock = new Swoole\Lock();
$c = 2;
while ($c--) {
go(function () use ($lock) {
$lock->lock();
Co::sleep(1);
$lock->unlock();
});
}
We are rethinking whether to maintain the module of the lock. It may not be removed.
Thank you for your feedback
Hello,
With the coming removal of Swoole Lock in v4.5, what is the new way to handle locking with Swoole Table in multi-processes/threads environment? The current document states:
Thanks!