Thread state vs. TCB, Thread life cycle

Source: Internet
Author: User

struct TCB {  u32_t status;  struct Reg_context thread_context;  void *stack;  struct Thread_info thread_params;  u32_t Executedtime;  struct TCB *recoverytask;  u32_t Sched_field;  u32_t Magic_key;};

Blocking state (Blocked)

During a thread run, it may enter a blocking state for various reasons:
1> thread goes to sleep by calling the sleep method;
The 2> thread invokes an operation that is blocked on I/O, that is, the operation does not return to its caller until the input-output operation is complete;
The 3> thread attempts to get a lock that is being held by another thread;
4> thread is waiting for a trigger condition;
......

The so-called blocking state is that the running thread is not running at the end, temporarily giving up the CPU, while other in the ready state of the thread can get CPU time, into the running state.

Thread state vs. TCB, Thread life cycle

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.