Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Thread safety
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
{{Short description|Concept in multi-threaded computer programming}} In [[multi-threaded]] [[computer programming]], a function is '''thread-safe''' when it can be invoked or accessed concurrently by multiple threads without causing unexpected behavior, [[race condition]]s, or data corruption.<ref>{{cite book |last=Kerrisk |first=Michael |title=The Linux Programing Interface |publisher=[[No Starch Press]] |year=2010 |page=699 |postscript=, "Chapter 31: THREADS: THREAD SAFETY AND PER-THREAD STORAGE"}}</ref><ref name=":1" /> As in the multi-threaded context where a program executes several threads simultaneously in a shared [[address space]] and each of those threads has access to every other thread's [[computer storage|memory]], thread-safe functions need to ensure that all those threads behave properly and fulfill their design specifications without unintended interaction.<ref name=":0">{{Cite web |publisher=[[Oracle Corporation|Oracle]] |first= |date=November 2020 |title=Multithreaded Programming Guide: Chapter 7 Safe and Unsafe Interfaces |url=https://docs.oracle.com/cd/E37838_01/html/E61057/compat-14994.html#scrolltoc |access-date=2024-04-30 |website=Docs Oracle |postscript=; "Thread Safety"}}</ref> There are various strategies for making thread-safe data structures.<ref name=":0" />
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)