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

Corrected the definition of coroutines #3136

Merged
merged 1 commit into from
Aug 15, 2024

Conversation

kchung1995
Copy link
Contributor

Corrected the definition of coroutines.

Coroutines are often compared to threads, as some of their characterists are similar. As result, coroutines are well described as lightweight threads in various references. This does not mean that coroutines are lightweight threads.
A single coroutine may work on more than a single thread throughout its lifecycle, being suspended and resumed. A single thread may run numerous coroutines sequentially.

The official document of Kotlin Coroutines also mentions this point. It describes as:

A coroutine is an instance of a suspendable computation. It is conceptually similar to a thread, in the sense that it takes a block of code to run that works concurrently with the rest of the code. However, a coroutine is not bound to any particular thread. It may suspend its execution in one thread and resume in another one.
Coroutines can be thought of as light-weight threads, but there is a number of important differences that make their real-life usage very different from threads.

@pivotal-cla
Copy link

@kchung1995 Please sign the Contributor License Agreement!

Click here to manually synchronize the status of this Pull Request.

See the FAQ for frequently asked questions.

@pivotal-cla
Copy link

@kchung1995 Thank you for signing the Contributor License Agreement!

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Aug 14, 2024
@mp911de mp911de added type: documentation A documentation update and removed status: waiting-for-triage An issue we've not yet triaged labels Aug 15, 2024
@mp911de mp911de self-assigned this Aug 15, 2024
@mp911de mp911de changed the title docs: corrected the definition of coroutines Corrected the definition of coroutines Aug 15, 2024
@mp911de mp911de merged commit 98c22d0 into spring-projects:main Aug 15, 2024
7 checks passed
mp911de pushed a commit that referenced this pull request Aug 15, 2024
mp911de pushed a commit that referenced this pull request Aug 15, 2024
@mp911de
Copy link
Member

mp911de commented Aug 15, 2024

It makes sense to update the definition to align with Kotlin's perspective.

Thank you for your contribution. That's merged and backported now.

@mp911de mp911de added this to the 3.2.9 (2023.1.9) milestone Aug 15, 2024
mipo256 pushed a commit to mipo256/spring-data-commons that referenced this pull request Sep 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: documentation A documentation update
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants