René's URL Explorer Experiment


Title: Threading memory model guarantees · Issue #1425 · jruby/jruby · GitHub

Open Graph Title: Threading memory model guarantees · Issue #1425 · jruby/jruby

X Title: Threading memory model guarantees · Issue #1425 · jruby/jruby

Description: The wiki page about concurrency says that updating an object instance var is not guaranteed to be visibile to other threads, although this action is thread safe. I cannot understand how this is possible under Java Memory Model: if the up...

Open Graph Description: The wiki page about concurrency says that updating an object instance var is not guaranteed to be visibile to other threads, although this action is thread safe. I cannot understand how this is pos...

X Description: The wiki page about concurrency says that updating an object instance var is not guaranteed to be visibile to other threads, although this action is thread safe. I cannot understand how this is pos...

Opengraph URL: https://github.com/jruby/jruby/issues/1425

X: @github

direct link

Domain: github.com

IPv4 address: 140.82.114.3


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Threading memory model guarantees","articleBody":"The wiki page about concurrency says that updating an object instance var is not guaranteed to be visibile to other threads, although this action is thread safe.\n\n1) I cannot understand how this is possible under Java Memory Model: if the update is thread safe, so we're using a lock or volatile variable some where, but those primitives ensure also visibility due to happens-before relation.\nAm I missing something or the wiki page is wrong?\n\nIf I'm wrong and the wiki page is right, we've a bigger problem.\n\nLook, for example, at this simple class\n\n``` ruby\nclass Counter\n  def initialize\n    @mutex = Mutex.new\n    @value = 0\n  end\n\n  def increment\n    @mutex.synchronize { @value = @value + 1 }\n  end\n\n  def value\n    @mutex.synchronize { @value }\n  end\n```\n\nNow, `@mutex` is set in constructor and is and instance variable, without visibility guarantees is possible that a thread sees it a `nil` when calling `increment`!\n(Java solves this issue ensuring that any final field is visible after an object is constructed, non-final field must be synchronized and we can use the implicit lock to do so or a final one)\nIn other word, to safely develop multithread code in Ruby we need at minimum to be sure that fields set in constructor are visibile at least when they are used as \"effectively final\" fields.\n\n2) if JRuby already provides that guarantee I think it should be added to the wiki page, otherwise the core should be modified to achieve this result\n\n(I've tried to look into sources and I think that JRuby already provide visibility between threads, but multihreading is very hard and it's better to be sure about those details :) ) \n","author":{"url":"https://github.com/mighe","@type":"Person","name":"mighe"},"datePublished":"2014-01-20T20:39:45Z","url":"https://github.com/jruby/jruby/issues/1425"}

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:801e2165-fc23-3fb7-a5fd-047307569bca
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idB038:3C44C0:3C9394:50C7EB:6B037E52
html-safe-nonce2d0c56c1bcfa3a4443d0cf5e61522332429eb02538ef7d0d73e60ef820aaa845
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCMDM4OjNDNDRDMDozQzkzOTQ6NTBDN0VCOjZCMDM3RTUyIiwidmlzaXRvcl9pZCI6IjE5NzA2NjkwODQ2OTM3MjQ3NTQiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmacf1e7bc5acc259c5d7c04d1f849c8e47e001f59d832519444d7be0f777cf65d8d
hovercard-subject-tagissue:25944905
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/jruby/jruby/1425/issue_layout
twitter:imagehttps://opengraph.githubassets.com/247503594d01e0b5cfc77d4ec60475da5389f95b628e9f70d8eacd8f82836230/jruby/jruby/issues/1425
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/247503594d01e0b5cfc77d4ec60475da5389f95b628e9f70d8eacd8f82836230/jruby/jruby/issues/1425
og:image:altThe wiki page about concurrency says that updating an object instance var is not guaranteed to be visibile to other threads, although this action is thread safe. I cannot understand how this is pos...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamemighe
hostnamegithub.com
expected-hostnamegithub.com
None87e774ee7c6b3bee0490394e4d3e57ec9dbc956f74b87ea685dc8996c1676456
turbo-cache-controlno-preview
go-importgithub.com/jruby/jruby git https://github.com/jruby/jruby.git
octolytics-dimension-user_id55687
octolytics-dimension-user_loginjruby
octolytics-dimension-repository_id168370
octolytics-dimension-repository_nwojruby/jruby
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id168370
octolytics-dimension-repository_network_root_nwojruby/jruby
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release423dbb54c5e7bfecc838eb387c1435eb3d0e760d
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/jruby/jruby/issues/1425#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fjruby%2Fjruby%2Fissues%2F1425
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fjruby%2Fjruby%2Fissues%2F1425
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=jruby%2Fjruby
Reloadhttps://github.com/jruby/jruby/issues/1425
Reloadhttps://github.com/jruby/jruby/issues/1425
Reloadhttps://github.com/jruby/jruby/issues/1425
jrubyhttps://github.com/jruby
jrubyhttps://github.com/jruby/jruby
Codehttps://github.com/jruby/jruby
Issues800 (800)https://github.com/jruby/jruby/issues
Pull requests138 (138)https://github.com/jruby/jruby/pulls
Discussionshttps://github.com/jruby/jruby/discussions
Actionshttps://github.com/jruby/jruby/actions
Projectshttps://github.com/jruby/jruby/projects
Wikihttps://github.com/jruby/jruby/wiki
Security and qualityhttps://github.com/jruby/jruby/security
Insightshttps://github.com/jruby/jruby/insights
https://github.com/jruby/jruby
New issuehttps://github.com/login?return_to=https://github.com/jruby/jruby/issues/1425
New issuehttps://github.com/login?return_to=https://github.com/jruby/jruby/issues/1425
Threading memory model guaranteeshttps://github.com/jruby/jruby/issues/1425#top
concurrencyhttps://github.com/jruby/jruby/issues?q=state%3Aopen%20label%3A%22concurrency%22
discusshttps://github.com/jruby/jruby/issues?q=state%3Aopen%20label%3A%22discuss%22
documentationhttps://github.com/jruby/jruby/issues?q=state%3Aopen%20label%3A%22documentation%22
Non-Releasehttps://github.com/jruby/jruby/milestone/29
https://github.com/mighe
mighehttps://github.com/mighe
on Jan 20, 2014https://github.com/jruby/jruby/issues/1425#issue-25944905
kareshttps://github.com/kares
concurrencyhttps://github.com/jruby/jruby/issues?q=state%3Aopen%20label%3A%22concurrency%22
discusshttps://github.com/jruby/jruby/issues?q=state%3Aopen%20label%3A%22discuss%22
documentationhttps://github.com/jruby/jruby/issues?q=state%3Aopen%20label%3A%22documentation%22
on Jan 17, 2017https://github.com/jruby/jruby/issues/1425#event-925926178
kareshttps://github.com/kares
Non-Releasehttps://github.com/jruby/jruby/milestone/29
on Jan 17, 2017https://github.com/jruby/jruby/issues/1425#event-925926474
Sign up for freehttps://github.com/signup?return_to=https://github.com/jruby/jruby/issues/1425
Sign in to commenthttps://github.com/login?return_to=https://github.com/jruby/jruby/issues/1425
concurrencyhttps://github.com/jruby/jruby/issues?q=state%3Aopen%20label%3A%22concurrency%22
discusshttps://github.com/jruby/jruby/issues?q=state%3Aopen%20label%3A%22discuss%22
documentationhttps://github.com/jruby/jruby/issues?q=state%3Aopen%20label%3A%22documentation%22
Non-ReleaseNo due datehttps://github.com/jruby/jruby/milestone/29
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Response headers:
Servergithub.com
Content-Typetext/html; charset=utf-8
Cache-Controlmax-age=0, private, must-revalidate

Viewport: width=device-width


URLs of crawlers that visited me.