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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T05:51:47+00:00 2026-05-25T05:51:47+00:00

Is there any mechanism through which I can wake up a thread in another

  • 0

Is there any mechanism through which I can wake up a thread in another process without going through the kernel? The waiting thread might spin in a loop, no problem (each thread is pegged to a separate core), but in my case the sending thread has to be quick, and can’t afford to go through the kernel to wake up the waiting thread.

  • 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-25T05:51:48+00:00Added an answer on May 25, 2026 at 5:51 am

    No, if the other thread is sleeping (not on CPU). To wake up such thread you need to change its state into “RUNNING” by calling scheduler which is part of the kernel.

    Yes, you can syncronize two threads or processes if both are running on different CPUs, and if there is shared memory between them. You should bind all threads to different CPUs. Then you may use spinlock:pthread_spin_lock and pthread_spin_unlock functions from optional part of POSIX’s Pthread ('(ADVANCED REALTIME THREADS)'; [THR SPI]); or any of custom spinlock. Custom spinlock most likely will use some atomic operations and/or memory barriers.

    Sending thread will change the value in memory, which is checked in loop by receiver thread.

    E.g.

    init:

    pthread_spinlock_t lock;
    pthread_spin_lock(&lock);  // close the "mutex"
    

    then start threads.

    waiting thread:

    {
    pthread_spin_lock(&lock); // wait for event;
    work();
    }
    

    main thread:

    {
    do_smth();
    pthread_spin_unlock(&lock); // open the mutex; other thread will see this change
     //  in ~150 CPU ticks (checked on Pentium4 and Intel Core2 single socket systems);
     // time of the operation itself is of the same order; didn't measure it.
    continue_work();
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there any query which can return me the number of revisions made to
Is there any mechanism in C# that allows one to define and declare an
Is there any way to check whether a file is locked without using a
I'm curious to know if there's any built-in mechanism to retry tests in the
I was going through Facebook's authentication mechanism. and understood the client side, server side
Had a look over SO but I can't see any threads which address my
Is there any way to implement a URL mechanisim in asp.net like it has
Are there any future plans to replace selenium and watir with mechanize + johnson?
Is there any free or commercial component written in .NET (no COM interop) that
Is there any efficiency difference in an explicit vs implicit inner join? For example:

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.