Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Use the new lock in CoreLib#103085

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
eduardo-vp merged 1 commit intodotnet:mainfromeduardo-vp:lock-coverage
Jun 5, 2024
Merged

Conversation

@eduardo-vp
Copy link
Member

No description provided.

@dotnet-policy-service
Copy link
Contributor

Tagging subscribers to this area:@mangod9
See info inarea-owners.md if you want to be subscribed.

@eduardo-vpeduardo-vp requested a review fromkouvelJune 5, 2024 18:31
@eduardo-vpeduardo-vp marked this pull request as ready for reviewJune 5, 2024 20:25
@eduardo-vp
Copy link
MemberAuthor

CI errors are known

@eduardo-vpeduardo-vp merged commite2f0476 intodotnet:mainJun 5, 2024
@EgorBo
Copy link
Member

EgorBo commentedJun 5, 2024
edited
Loading

@kouvel I am just wondering - does F# have a special treatment for Lock too?

Also, should Monitor.TryEnter throw an error if Lock object is passed? so other CIL languages could realize they need a special treatment here

cc@vzarytovskii

@vzarytovskii
Copy link
Member

lock in F# is just a function, which takes a lock object and a function. No special treatment.

@EgorBo
Copy link
Member

EgorBo commentedJun 5, 2024
edited
Loading

lock in F# is just a function, which takes a lock object and a function. No special treatment.

From my understanding, the problem is - we now have this Lock type and it shouldn't be used (behind the scene) with Monitor type, otherwise if user defines aLock lock object and then mixes its usage withlock keyword or f# function (doesn't matter) with explicit TryEnter/Scope APIs they might run into terrible hard-to-repro bugs

@kouvel
Copy link
Contributor

Yea that's a good point. I'm not sure if there's a way to disallowLock-typed objects to be used statically with thelock function. At least that would be a deterrent but theLock type could also be easily casted away. Not sure if there is a good solution to that, thoughts?

@kouvel
Copy link
Contributor

kouvel commentedJun 6, 2024
edited
Loading

A run-time check adds a bit of measurable cost to locking, and if done in thelock function may also increase code size because it seems to be inlined. Or maybe there should be some guidance such as not to useLock withlock in F#?

@github-actionsgithub-actionsbot locked and limited conversation to collaboratorsJul 7, 2024
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.

Reviewers

@EgorBoEgorBoEgorBo left review comments

@mangod9mangod9mangod9 left review comments

@stephentoubstephentoubstephentoub approved these changes

+1 more reviewer

@kouvelkouvelkouvel approved these changes

Reviewers whose approvals may not affect merge requirements

Assignees

@eduardo-vpeduardo-vp

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

6 participants

@eduardo-vp@EgorBo@vzarytovskii@kouvel@stephentoub@mangod9

[8]ページ先頭

©2009-2025 Movatter.jp