Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6649021
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T00:43:29+00:00 2026-05-26T00:43:29+00:00

What are all the possible thread states during execution for native (C/C++) threads on

  • 0

What are all the possible thread states during execution for native (C/C++) threads on an Android device? Are they the same as the Java Thread States? Are they Linux threads? POSIX threads?

Not required, but bonus points for providing examples of what can cause a thread to enter each state.

Edit: As requested, here’s the motivation:

I’m designing the interface for a sampling profiler that works with native C/C++ code on Android. The profiler reports will show thread states over time. I need to know what all the states are in order to a) know how many distinct states I will need to possibly visually differentiate, and b) design a color scheme that visually differentiates and groups the desirable states versus the undesirable states.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T00:43:30+00:00Added an answer on May 26, 2026 at 12:43 am

    I’ve been told that native threads on Android are just lightweight processes. This agrees with what I’ve found for Linux in general. Quoting this wiki page:

    A process (which includes a thread) on a Linux machine can be in any of the following states:

    • TASK_RUNNING – The process is either executing on a CPU or waiting to be executed.
    • TASK_INTERRUPTIBLE – The process is suspended (sleeping) until some condition becomes true. Raising a hardware interrupt, releasing a system resource the process is waiting for, or delivering a signal are examples of conditions that might wake up the process (put its state back to TASK_RUNNING). Typically blocking IO calls (disk/network) will result in the task being marked as TASK_INTERRUPTIBLE. As soon as the data it is waiting on is ready to be read an interrupt is raised by the device and the interrupt handler changes the state of the task to TASK_INTERRUPTIBLE. Also processes in idle mode (ie not performing any task) should be in this state.
    • TASK_UNINTERRUPTIBLE – Like TASK_INTERRUPTIBLE, except that delivering a signal to the sleeping process leaves its state unchanged. This process state is seldom used. It is valuable, however, under certain specific conditions in which a process must wait until a given event occurs without being interrupted. Ideally not too many tasks will be in this state.
      • For instance, this state may be used when a process opens a device file and the corresponding device driver starts probing for a corresponding hardware device. The device driver must not be interrupted until the probing is complete, or the hardware device could be left in an unpredictable state.
      • Atomic write operations may require a task to be marked as UNINTERRUPTIBLE
      • NFS access sometimes results in access processes being marked as UNINTERRUPTIBLE
        reads/writes from/to disk can be marked thus for a fraction of a second
      • I/O following a page fault marks a process UNINTERRUPTIBLE
      • I/O to the same disk that is being accessed for page faults can result in a process marked as UNINTERRUPTIBLE
      • Programmers may mark a task as UNINTERRUPTIBLE instead of using INTERRUPTIBLE
    • TASK_STOPPED – Process execution has been stopped; the process enters this state after receiving a SIGSTOP, SIGTSTP, SIGTTIN, or SIGTTOU signal.
    • TASK_TRACED – Process execution has been stopped by a debugger.
    • EXIT_ZOMBIE – Process execution is terminated, but the parent process has not yet issued a wait4() or waitpid() system call. The OS will not clear zombie processes until the parent issues a wait()-like call.
    • EXIT_DEAD – The final state: the process is being removed by the system because the parent process has just issued a wait4() or waitpid() system call for it. Changing its state from EXIT_ZOMBIE to EXIT_DEAD avoids race conditions due to other threads of execution that execute wait()-like calls on the same process.

    Edit: And yet the Dalvik VM Debug Monitor provides different states. From its documentation:

    "thread state" must be one of:

    1 – running (now executing or ready to do so)
    2 – sleeping (in Thread.sleep())
    3 – monitor (blocked on a monitor lock)
    4 – waiting (in Object.wait())
    5 – initializing
    6 – starting
    7 – native (executing native code)
    8 – vmwait (waiting on a VM resource)

    "suspended" [a separate flag in the data structure] will be 0 if the thread is running, 1 if not.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is it possible to enumerate all managed threads in C#? Visual Studio seems to
Possible Duplicate: Could you explain STA and MTA? All ThreadPool threads are in the
Java requires that you catch all possible exceptions or declare them as thrown in
I need all of my threads to check periodically that they should still be
Is it at all possible to do database-agnostic table dumps/hydrates? I don't have any
Is the following at all possible in c#? I have the following but the
Algorithm to generate all possible letter combinations of given string down to 2 letters
Is there a place to find all possible uses of the syscmd method in
I needed an algorithm to generate all possible partitions of a positive number, and
I'm wondering if it is at all possible to get the total duration of

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.