Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.programming.threads > #1088

Re: String multithreading issue

Path csiph.com!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder1.enfer-du-nord.net!feeds.phibee-telecom.net!dedekind.zen.co.uk!zen.net.uk!hamilton.zen.co.uk!reader01.nrc01.news.zen.net.uk.POSTED!not-for-mail
Newsgroups comp.programming.threads
From Geoff Clare <geoff@clare.See-My-Signature.invalid>
Subject Re: String multithreading issue
References <0992cd7c-02bf-47e6-8c88-a171b7de8408@googlegroups.com> <k3fedn$6kd$1@mx1.internetia.pl> <505c048c$0$6575$9b4e6d93@newsspool3.arcor-online.net>
User-Agent XPN/1.2.6 (Street Spirit ; Linux)
MIME-Version 1.0
Content-Type text/plain; charset=ISO-8859-1
Content-Transfer-Encoding 8bit
Date Fri, 21 Sep 2012 13:42:05 +0100
Message-ID <tt3ui9-1en.ln1@leafnode-msgid.gclare.org.uk> (permalink)
Lines 21
Organization Zen Internet
NNTP-Posting-Host 18336f1d.news.zen.co.uk
X-Trace DXC=ilZ9__>Sl]LgN9e0JNPkjOa0UP_O8AJoL=dR0\ckLKG@WeZ<[7LZNRFP5>N9ZB9<H@Ge\aWc^aheF0ETdE17DIfK8Pb<YCmXn<M
X-Complaints-To abuse@zen.co.uk
Xref csiph.com comp.programming.threads:1088

Show key headers only | View raw


Marcel Müller wrote:

> On 20.09.2012 17:53, bartek szurgot wrote:
>> you do not join your threads, so you have a race - if threads will not
>> end before program exits, you have a problem.
>
> Does pthreads kill the process, if the main thread ends?
> Or is this just undefined behavior?

Returning from the initial call to main() is equivalent to calling
exit().  (The process is not killed; it terminates normally. Well,
"normally" as far as its parent can tell. I don't mean to imply that
exiting while other threads are running is a normal thing to do.)

You can call pthread_exit() instead of returning from main(), and
then the process will continue running until all of the other
threads have terminated.

-- 
Geoff Clare <netnews@gclare.org.uk>

Back to comp.programming.threads | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

String multithreading issue itt ium <ittium@gmail.com> - 2012-09-20 00:50 -0700
  Re: String multithreading issue Marcel Müller <news.5.maazl@spamgourmet.com> - 2012-09-20 11:54 +0200
  Re: String multithreading issue bartek szurgot <basz@no.spam> - 2012-09-20 17:53 +0200
    Re: String multithreading issue Marcel Müller <news.5.maazl@spamgourmet.com> - 2012-09-21 08:09 +0200
      Re: String multithreading issue Geoff Clare <geoff@clare.See-My-Signature.invalid> - 2012-09-21 13:42 +0100
  Re: String multithreading issue Marc <marc.glisse@gmail.com> - 2012-09-20 16:37 +0000

csiph-web