Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[6.0]Support coroutine lock #5557

Merged
merged 1 commit into from
Nov 8, 2024

Conversation

NathanFreeman
Copy link
Member

No description provided.

Copy link

codecov bot commented Nov 7, 2024

Codecov Report

Attention: Patch coverage is 82.97872% with 8 lines in your changes missing coverage. Please review.

Project coverage is 70.92%. Comparing base (0c6b552) to head (eab90cd).
Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
src/lock/coroutine_lock.cc 82.97% 8 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #5557      +/-   ##
==========================================
+ Coverage   70.88%   70.92%   +0.04%     
==========================================
  Files         108      109       +1     
  Lines       16713    16761      +48     
  Branches     3057     3063       +6     
==========================================
+ Hits        11847    11888      +41     
- Misses       4810     4817       +7     
  Partials       56       56              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@NathanFreeman NathanFreeman force-pushed the feature/coroutine_lock branch 2 times, most recently from 894ed12 to ae5f6a5 Compare November 7, 2024 15:07
@matyhtf
Copy link
Member

matyhtf commented Nov 8, 2024

  1. 对 IouringEvent 的修改,完全与 SQE 对齐,那这个 struct 就没有存在的意义了,还不如直接用 sqe 结构体。本质上 IouringEvent 是为了与 unistd 中的函数参数一致,作为一个中间层,保留 unistd 的参数命名,在 dispatch 时转化为 sqe 结构。当前修改中例如:event.len = mode event.off = (uintptr_t) &_statxbuf 这就丝毫没有可读性
  2. SW_ERROR_CO_NOT_EXISTS 这个错误码是不对的,正确的应该是 out of coroutine
  3. 锁的接口需要 return error; 然后 会设置到errCode属性上,return 1 是错误的,
  4. (System::sleep((double) 0.1) 锁等待时间为固定的100ms,这个设计存在问题,如果锁在1ms之内就被释放了,这个锁等待的时间就放大了100倍,完全无法使用

@NathanFreeman NathanFreeman force-pushed the feature/coroutine_lock branch 2 times, most recently from bda1939 to 5f7adf6 Compare November 8, 2024 07:30
@matyhtf matyhtf merged commit a38920d into swoole:master Nov 8, 2024
38 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants