From: Taci ÃÂlker <uelker@uni-paderborn.de>
To: Pthreads Developers List <pthreads-win32@sourceware.cygnus.com>
Subject: Question about condition variable
Date: Wed, 14 Jun 2000 18:06:00 -0000 [thread overview]
Message-ID: <39482BD2.7A4DE7D5@uni-paderborn.de> (raw)
In-Reply-To: <14463.19695.396800.542343@cabletron.com>
Hello all,
I am developing a software based on win32-pthreads (latest available).
My problem I encountered is:
I have an object for message queuing, wich is intended to let the
callers thread wait by getMessage(LPSSMSG lpMsg), until a new
message is posted by any other thread. Now imagine, the thread
which is waiting for new messages is in status ACTIVE (sleeping or
not running) in operating system. The thread wich is posting a new
message is in status RUNNING. This running thread pushes at first
a new message into the queue and signals the waiting thread to be
waked up and unlocks the mutex immediately, so that other threads
can push further new messages.
Now, the problem is when the signal is given to wake up the waiting
thread by the first message pushing thread then the OS dont switch
automatically its thread execution. This means if the thread is not
waked up, because it is not switched to stutus RUNNING and an other
thread pushes further new message in to the queue and signals also
the waiting thread then what is about the first and second signals?
I am actually switching thread execution with sleep(0) function,
after each message posting.
next prev parent reply other threads:[~2000-06-14 18:06 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <000601bf578e$3c89a750$208e08d0@fflaptop>
2000-01-05 17:35 ` C++ cleanup handler execution Ross Johnson
2000-01-06 14:11 ` Kevin D. Clark
2000-01-06 18:17 ` Ross Johnson
2000-01-14 8:19 ` Kevin D. Clark
2000-01-14 8:27 ` Kevin D. Clark
2000-01-14 8:30 ` Kevin D. Clark
2000-01-14 8:36 ` Kevin D. Clark
2000-02-02 10:08 ` pthread_cancel() problems Kevin D. Clark
2000-06-14 18:06 ` Taci Ãlker [this message]
[not found] ` <3949054F.3127@surfnshop.com>
2000-06-16 7:33 ` Question about condition variable Taci Ãlker
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=39482BD2.7A4DE7D5@uni-paderborn.de \
--to=uelker@uni-paderborn.de \
--cc=pthreads-win32@sourceware.cygnus.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).