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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T09:55:17+00:00 2026-05-26T09:55:17+00:00

I am using many pthread mutex’s. My program uses them and then, at a

  • 0

I am using many pthread mutex’s. My program uses them and then, at a certain point I want to do a soft restart of my program, I am repeating “Soft-restart”, not hard restart. By soft restart I mean, I will not exit the program by, I start the program once more using “goto” statement, which starts at the start of the program, to once again run the program.

My doubt is, if I am using the mutex’s in my program and in the mid way, I get a soft-restart, where I am initializing this mutex’s. Will they be initialized irrespective of where they were in the program.

I checked with normal datatypes like “int”, they get initialized to what ever we specified at the restart. But, I want some confidence from you all about mutex’s.

  • 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-26T09:55:18+00:00Added an answer on May 26, 2026 at 9:55 am

    If you call ‘pthread_mutex_init’ on them, they will be initialized as if they were new mutexes. Just make sure no thread is or might be accessing them as you attempt to re-initialize them.

    However, your notion of soft restarting sounds a bit off to me. If I had to implement such a thing (and I’d resist it to the ends of the Earth) I’d do it by getting rid of all previous objects and creating new ones, not by trying to reuse the leftover cruft from the previous run.

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

Sidebar

Related Questions

So after writing a large .tex file and using many packages I want to
I am using many text boxes in a form. How do i validate them,
I have been in both situations: Creating too many custom Exceptions Using too many
I was browsing for an alternative to using so many shared_ptrs, and found an
I am trying to delete records in many to many using Doctrine. I used
For obvious productivity reasons, I make an effort of learning and using as many
I'm trying to compile many files using the Compiler API. Say I have a
I can draw many things using this : NSString *imagePath = [[NSBundle mainBundle] pathForResource:@dummy2.png
Let's say I have many-to-many relationship (using the ActiveRecord attribute HasAndBelongsToMany) between Posts and
I'm setting up a database using PHPMyAdmin and many fields will be large chunks

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.