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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T22:21:45+00:00 2026-05-27T22:21:45+00:00

The usage case is that one application generates an event and sends out a

  • 0

The usage case is that one application generates an event and sends out a signal that any application that cares to listen for it will get. E.g. an application updates the contents of a file and signals this. On Linux this could be done by the waiters calling inotify on the file. One portable way would be for listeners to register with a well-known server, but I would prefer something simpler if possible. As portable as possible ideally means using only POSIX features which are also widely available.

  • 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-27T22:21:45+00:00Added an answer on May 27, 2026 at 10:21 pm

    Option using lock files

    You can do this by locking a file.

    Signal emitter initial setup:

    • Create a file with a well-known name and lock it for writing (fcntl(F_SETLK) with F_WRLCK or flock(LOCK_EX)`).

    Signal receiver procedure:

    • Open the file using the well-known filename and try to obtain a read lock on it (fcntl(F_SETLK) with F_RDLCK or flock(LOCK_SH)).
    • Receiver blocks because the emitter is holding a conflicting write lock.

    Signal emission:

    • Signal emitter creates a new temporary file
    • Signal emitter obtains a write lock on the new temporary file
    • Signal emitter renames the new temporary file to the well-known filename. This clobbers the old lock file but the waiting receivers all retain references to it.
    • Signal emitter closes the old lock file. This also releases the lock.
    • Signal receivers all wake up because now they can obtain their read locks.
    • Signal receivers should close the file they’ve just obtained a lock on. It won’t be used again. If they want to wait for the condition to happen again they should reopen the file.

    In the signal emitter, the temporary lock file which has been renamed over top of the original lock file now becomes the new current lock file.

    Option using network multicast

    Have the receivers join a multicast group and wait for packets. Have the signal emitter send UDP packets to that multicast group.

    You can bind both the sending and receiving UDP sockets to the loopback interface if you want it to use only host-local communication.

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

Sidebar

Related Questions

What are some useful Oracle optimizations one can use for an Application that mostly
One of my application is an engine that executes some complex calculations. These calculations
Our usage case is a database responsible for accounts, sessions, licenses, etc. — it
I have an application that uses coldfusion's session management (instead of the J2EE) session
Just out of curiosity, for applications that have a fairly complicated module tree, would
I am writing an application for OS X (Obj-C/Cocoa) that runs a simulation and
Having a weird problem. I'm testing an ASP.NET application I wrote that queries SQL
I have an old ASP.NET application. We send out httpWebRequest to a remote REST
in the past we encountered various memory-leaks in our software. We found out that
Does someone have any tips/advice on database design for a web application? The kind

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.