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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T18:47:24+00:00 2026-05-14T18:47:24+00:00

people. For a academic exercise i have to implement a program in c for

  • 0

people. For a academic exercise i have to implement a program in c for nix platform which is to synchronize multiple processes through signal handling, using only signal,pause,kill and fork basic functions.
I searched google and have not found any clear example: I hope the wisdom of one of you will light my way.
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-14T18:47:24+00:00Added an answer on May 14, 2026 at 6:47 pm

    pause doesn’t return until a signal is received. The basic design is thus:

    • fork to create the necessary workers
    • catch SIGINT in each worker. The handler sets a flag meaning the process should exit after finishing it’s current job.
    • each process does work while it can, then pauses. Repeat unless SIGINT is received (test before & after pause).
    • when one process has work available for another process, it signals the other process with SIGCONT
    • when there is no more work for a process, signal it with SIGINT.

    This doesn’t quite include synchronized access to shared data. To do that, you could add an additional rule:

    • when a process signals another that work is available, it should pause

    Of course, this rather defeats the purpose of concurrent programming.

    Since most system calls are interrupted by signals (causing them to return -1, with errno set to EINTR), you’ll have to handle this contingency, repeating each affected system call until it’s successful. For example:

    while ((readCount = read(...)) < 0 && errno == EINTR) {}
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

People familiar with Homographies will know that you have to normalize it dividing by
people. I have slight problem with GD2 text on image. I have everything working
Hi people thanks for the help. Im trying to implement a simple pagination that
I have the following query: select * from ACADEMIC a left join RESIDENCY r
I have the following query: select r.people_code_id [People Code ID], r.resident_commuter [Campus6], c1.udormcom [AG],
People have been embedding and executing VBScript within batch files for a long time.
People use void main() /*empty parens ()*/ I have been taught to write void
I am planning to implement a small-scale data acquisition system on an RTOS platform.
I have just started to look at the Scala collections library re-implementation which is
People have been able to build PCRE (or a subset of) by copying the

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.