From: Hendrik Visage <hvjunk@gmail.com>
To: Randi Botse <nightdecoder@gmail.com>
Cc: linux-c-programming <linux-c-programming@vger.kernel.org>
Subject: Re: Co-thread for parallel processing
Date: Sat, 3 Dec 2011 23:13:46 +0200 [thread overview]
Message-ID: <CADtGFvmHhhnafSkXJHLRQqhc_dd-r5DMf7t2355FvP1nqZ6iGw@mail.gmail.com> (raw)
In-Reply-To: <CAA6iF_4z_MPpU8Eq+i+PT-+VgpX_ZXX5FwOwa2NpLxW_gyzTSg@mail.gmail.com>
On Fri, Dec 2, 2011 at 11:23 AM, Randi Botse <nightdecoder@gmail.com> wrote:
> 1. What the proper way to the main thread to wait for all co-threads
> until finished?
I'll do a semop() with sem_op=1 in each thread's start, and a
sem_op=-1 when each thread's finished.
Then in the main thread I'll wait with a sem_op = 0.
> 2. After calling pthread_cond_signal() or pthread_cond_broadcast()
> followed by sleep()/nanosleep(),
> the condition variable looks like not signaled, (the co-thread
> routine doesn't run). What make this?
Please show the code snippet in the co-thread that is not working as
well as the mainthread's method you try to wake up the co-threads
--
To unsubscribe from this list: send the line "unsubscribe linux-c-programming" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
prev parent reply other threads:[~2011-12-03 21:13 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-12-02 9:23 Co-thread for parallel processing Randi Botse
2011-12-02 9:28 ` Bogdan Cristea
2011-12-02 10:10 ` Randi Botse
2011-12-02 11:26 ` Srinivasa T N
2011-12-03 21:13 ` Hendrik Visage [this message]
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=CADtGFvmHhhnafSkXJHLRQqhc_dd-r5DMf7t2355FvP1nqZ6iGw@mail.gmail.com \
--to=hvjunk@gmail.com \
--cc=linux-c-programming@vger.kernel.org \
--cc=nightdecoder@gmail.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 NNTP newsgroup(s).