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 6636671
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T23:12:55+00:00 2026-05-25T23:12:55+00:00

I am using pthread library for multi-threading. Inside thread function, I use sleep system

  • 0

I am using pthread library for multi-threading. Inside thread function, I use sleep system call. Will this block a single thread or the whole process. Thanks.

  • 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-25T23:12:56+00:00Added an answer on May 25, 2026 at 11:12 pm

    Generally, sleep affects only the calling thread. Real, kernel-managed threads run independently of each other. In an app that has “green” threads, though (not native to the OS; managed by the app itself), a system call that blocks may block everything. But that kind of brokenness is rather rare — software managing green threads tends to provide a whole runtime environment, including ways to sleep without resorting to a system call.

    The better question is…do you really need to sleep at all? Time-based synchronization tends to lead to race conditions and fragile apps. There’s a way for threads to wait on and trigger each other; that leads to better determinism.

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

Sidebar

Related Questions

i'm working with a multi-threaded program (using pthreads) that currently create a background thread
I've been using the pthread library for creating & joining threads in C. When
I am using the pthread library to simulate a threaded buffer. I am also
We have an application that creates several threads using the pthread library. As we
I am using C# in Mono and I'm trying to use pinvoke to call
I'm maintaining a library that has a function that needs thread specific variables. Due
I'm trying to implement this simple example of how to synchronize threads using pthread
Using the pthread library in C, is it possible to send a SIGSTOP signal
What free tools can I use to debug multithreaded programs created using the pthread
I load the pthread library in my program using dlopen , and fetch handlers

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.