From: Jan-Benedict Glaw <jbglaw@lug-owl.de>
To: linux-c-programming@vger.kernel.org
Subject: Re: Problem with pthreads on socket
Date: Sun, 7 Nov 2004 18:05:07 +0100 [thread overview]
Message-ID: <20041107170507.GB10443@lug-owl.de> (raw)
In-Reply-To: <20041107091517.63691.qmail@web90004.mail.scd.yahoo.com>
[-- Attachment #1: Type: text/plain, Size: 1656 bytes --]
On Sun, 2004-11-07 01:15:17 -0800, Linux Kernel <linuxkrnl@yahoo.com>
wrote in message <20041107091517.63691.qmail@web90004.mail.scd.yahoo.com>:
> >From what i understand,in fact, this threads are
> working asynchronus and by using mutex, to be a switch
> between threads.
Correct is that they're asynchronous to each other. But mutexes aren't
used to switch between them. Mutexes are used to lock-out any other
thready while accessing commonly-used resources.
For example, if you have an application that echoes everything back, you
probably don't need *any* mutexes at all, because receiving one byte and
sending it back doesn't access any commonly used resources.
> I wish to know how the threads can run synchronus or
> totally independent.
They are independant. If you need "synchronous" working mode, you
probably shouldn't use threads at all:-)
> If you know, some how, a sample source code which is
> working, please tell me.
> P.S. I can send by e-mail the entire source code.
Maybe first start with an exact description of what needs to be done. To
speak honest (and not offending), parts of your sources looked quite
spaghetti-like (but that may be because of cutting out any unneeded
code). So maybe a description of the exact task would be a better start
here...
MfG, JBG
--
Jan-Benedict Glaw jbglaw@lug-owl.de . +49-172-7608481 _ O _
"Eine Freie Meinung in einem Freien Kopf | Gegen Zensur | Gegen Krieg _ _ O
fuer einen Freien Staat voll Freier Bürger" | im Internet! | im Irak! O O O
ret = do_actions((curr | FREE_SPEECH) & ~(NEW_COPYRIGHT_LAW | DRM | TCPA));
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
next prev parent reply other threads:[~2004-11-07 17:05 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-11-06 10:45 Problem with pthreads on socket Linux Kernel
2004-11-06 21:15 ` Jan-Benedict Glaw
2004-11-07 9:15 ` Linux Kernel
2004-11-07 17:05 ` Jan-Benedict Glaw [this message]
-- strict thread matches above, loose matches on Subject: below --
2004-11-07 13:09 Ron Michael Khu
2004-11-07 17:47 ` Linux Kernel
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=20041107170507.GB10443@lug-owl.de \
--to=jbglaw@lug-owl.de \
--cc=linux-c-programming@vger.kernel.org \
/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).