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

Threads as smallest sequences? #12

Open
gadamico opened this issue Apr 28, 2016 · 2 comments
Open

Threads as smallest sequences? #12

gadamico opened this issue Apr 28, 2016 · 2 comments

Comments

@gadamico
Copy link

The Wikipedia article on threads says: "In computer science, a thread of execution is the smallest sequence of programmed instructions that can be managed independently by a scheduler, which is typically a part of the operating system."

What does 'smallest' mean here? And if it has some normal meaning, then why wouldn't the smallest such sequence have only one instruction in it (or even zero instructions)? Is it somehow the case that, when a sequence gets sufficiently small, its execution cannot be handled by a scheduler?

@quantheory
Copy link
Member

I believe that what the Wikipedia entry means is that a scheduler may be aware of a hierarchy of instruction sequences, so a thread is contained in a process, a process may be part of some group of processes defined by the scheduler.

The thread is the "smallest" unit in the sense that the scheduler can't break it up into smaller pieces to run concurrently. That doesn't mean that it's the smallest sequence of instructions that can exist on the hardware, just the scheduler is not able to divide it up into smaller "streams" of instructions that can run independently. Whereas a process can be running on more than one core (or be run "out of order" on a single core) if it has more than one thread in it.

@gadamico gadamico changed the title Threads as Threads as smallest sequences? Apr 29, 2016
@gadamico
Copy link
Author

That helps. Thanks, Sean.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants