Skip to content

timeout: add support for completion_count in timeout call#79

Closed
bikallem wants to merge 2 commits intoocaml-multicore:mainfrom
bikallem:timeout-nr
Closed

timeout: add support for completion_count in timeout call#79
bikallem wants to merge 2 commits intoocaml-multicore:mainfrom
bikallem:timeout-nr

Conversation

@bikallem
Copy link
Copy Markdown
Contributor

@bikallem bikallem commented Aug 29, 2022

This PR adds support for specifying 'completion (cqe) count' when issuing timeout sqe to uring. By specifying completion_count, timeout sqe returns 0 - success - when the specified number of completion_count cqes complete.

The parameter is an optional type with default value of 0 to make it backwards compatible with earlier release.

I have also made a performance improvement to set_timespec c stub function by reducing the need to allocate int64.

submit_timeout c stub is also implemented in 2 c stubs since it has exceeded 5 parameters limit of OCaml stub functions.

@bikallem bikallem requested review from haesbaert and talex5 August 29, 2022 11:23
Add more tests to demonstrate the use of `completion_count` parameter.
Fix the int -> intnat in c stubs.
@haesbaert
Copy link
Copy Markdown
Contributor

haesbaert commented Sep 8, 2022

I don't get why intnat completion_count, what's wrong with v_completion_count and Int_val(v_completion_count) ?
Also, I'd condense v_clock and v_absolute int a v_flags which is a list for each bit, that saves the extra parameter and you don't need the native/byte stuff.
The rest of the code is not breaking line on the function arguments so I wouldn't as well.
(edited: because of the pornographic amount of typos)

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.

3 participants