From owner-freebsd-threads@FreeBSD.ORG Mon Apr 16 07:55:53 2007 Return-Path: X-Original-To: freebsd-threads@freebsd.org Delivered-To: freebsd-threads@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 0EFB916A403 for ; Mon, 16 Apr 2007 07:55:53 +0000 (UTC) (envelope-from manojk@huawei.com) Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [61.144.161.54]) by mx1.freebsd.org (Postfix) with ESMTP id 0CC6313C46A for ; Mon, 16 Apr 2007 07:55:40 +0000 (UTC) (envelope-from manojk@huawei.com) Received: from huawei.com (szxga02-in [172.24.2.6]) by szxga02-in.huawei.com (iPlanet Messaging Server 5.2 HotFix 1.25 (built Mar 3 2004)) with ESMTP id <0JGK001JPUNYNG@szxga02-in.huawei.com> for freebsd-threads@freebsd.org; Mon, 16 Apr 2007 14:14:23 +0800 (CST) Received: from huawei.com ([172.24.1.24]) by szxga02-in.huawei.com (iPlanet Messaging Server 5.2 HotFix 2.14 (built Aug 8 2006)) with ESMTP id <0JGK00HCVUNX5O@szxga02-in.huawei.com> for freebsd-threads@freebsd.org; Mon, 16 Apr 2007 14:14:22 +0800 (CST) Received: from m71340 ([10.70.149.100]) by szxml04-in.huawei.com (iPlanet Messaging Server 5.2 HotFix 1.25 (built Mar 3 2004)) with ESMTPA id <0JGK003H7UNTFQ@szxml04-in.huawei.com> for freebsd-threads@freebsd.org; Mon, 16 Apr 2007 14:14:21 +0800 (CST) Date: Mon, 16 Apr 2007 14:14:17 +0800 From: Manoj To: freebsd-threads@freebsd.org Message-id: <000001c77fee$76de69a0$6495460a@china.huawei.com> MIME-version: 1.0 X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 X-Mailer: Microsoft Office Outlook 11 Content-type: multipart/related; boundary="Boundary_(ID_KgaU7a2dLNnnYxsVLC/q1g)" Thread-index: Acd/7nZW2RO0ZA4HRRuHmFMRFB5YDg== X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Subject: "sleep" "select" system call not work correctly when linking with pthread in linux...................... X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Apr 2007 07:55:53 -0000 This is a multi-part message in MIME format. --Boundary_(ID_KgaU7a2dLNnnYxsVLC/q1g) Content-type: text/plain; charset=us-ascii Content-transfer-encoding: 7BIT HI Can I know, as to why the select system call has problem, when we link it with thread library. I use the same in my code. The response is not consistent. So can you please provide more information on this. Thanks & Regards, Manoj Kulkarni. Software Engg. Huawei Technologies, R&D Center, Shenzhen, China. ------------------------------------------------------------------- This e-mail and attachments contain confidential information from HUAWEI, which is intended only for the person or entity whose address is listed above. Any use of the information contained herein in any way (including, but not limited to, total or partial disclosure, reproduction, or dissemination) by persons other than the intended recipient's) is prohibited. If you receive this e-mail in error, please notify the sender by phone or email immediately and delete it! _____ --Boundary_(ID_KgaU7a2dLNnnYxsVLC/q1g)-- From owner-freebsd-threads@FreeBSD.ORG Mon Apr 16 11:08:53 2007 Return-Path: X-Original-To: freebsd-threads@FreeBSD.org Delivered-To: freebsd-threads@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 37F8C16A52C for ; Mon, 16 Apr 2007 11:08:53 +0000 (UTC) (envelope-from owner-bugmaster@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [69.147.83.40]) by mx1.freebsd.org (Postfix) with ESMTP id 2747F13C4C8 for ; Mon, 16 Apr 2007 11:08:53 +0000 (UTC) (envelope-from owner-bugmaster@FreeBSD.org) Received: from freefall.freebsd.org (linimon@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.4/8.13.4) with ESMTP id l3GB8q2Q043023 for ; Mon, 16 Apr 2007 11:08:52 GMT (envelope-from owner-bugmaster@FreeBSD.org) Received: (from linimon@localhost) by freefall.freebsd.org (8.13.4/8.13.4/Submit) id l3GB8p1I043007 for freebsd-threads@FreeBSD.org; Mon, 16 Apr 2007 11:08:51 GMT (envelope-from owner-bugmaster@FreeBSD.org) Date: Mon, 16 Apr 2007 11:08:51 GMT Message-Id: <200704161108.l3GB8p1I043007@freefall.freebsd.org> X-Authentication-Warning: freefall.freebsd.org: linimon set sender to owner-bugmaster@FreeBSD.org using -f From: FreeBSD bugmaster To: freebsd-threads@FreeBSD.org Cc: Subject: Current problem reports assigned to you X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Apr 2007 11:08:53 -0000 Current FreeBSD problem reports Critical problems S Tracker Resp. Description -------------------------------------------------------------------------------- s threa/76690 threads fork hang in child for -lc_r 1 problem total. Serious problems S Tracker Resp. Description -------------------------------------------------------------------------------- o kern/20016 threads pthreads: Cannot set scheduling timer/Cannot set virtu s threa/24472 threads libc_r does not honor SO_SNDTIMEO/SO_RCVTIMEO socket o s threa/24632 threads libc_r delicate deviation from libc in handling SIGCHL s bin/32295 threads pthread dont dequeue signals s threa/34536 threads accept() blocks other threads o kern/38549 threads the procces compiled whith pthread stopped in pthread_ s threa/39922 threads [threads] [patch] Threaded applications executed with s threa/48856 threads Setting SIGCHLD to SIG_IGN still leaves zombies under s threa/49087 threads Signals lost in programs linked with libc_r s kern/64313 threads FreeBSD (OpenBSD) pthread implicit set/unset O_NONBLOC o threa/70975 threads unexpected and unreliable behaviour when using SYSV se o threa/72429 threads threads blocked in stdio (fgets, etc) are not cancella o threa/72953 threads fork() unblocks blocked signals w/o PTHREAD_SCOPE_SYST o threa/75273 threads FBSD 5.3 libpthread (KSE) bug o threa/75374 threads pthread_kill() ignores SA_SIGINFO flag s threa/76694 threads fork cause hang in dup()/close() function in child (-l o threa/79683 threads svctcp_create() fails if multiple threads call at the o threa/80435 threads panic on high loads o threa/83914 threads [libc] popen() doesn't work in static threaded program s threa/84483 threads problems with devel/nspr and -lc_r on 4.x o threa/85160 threads [libthr] [patch] libobjc + libpthread/libthr crash pro o threa/90278 threads libthr, ULE and -current produces >100% WCPU with apac o kern/91266 threads [threads] Trying sleep, but thread marked as sleeping s threa/94467 threads send(), sendto() and sendmsg() are not correct in libc f threa/98256 threads gnome-system-monitor core dumps from pthread_testcance s threa/100815 threads FBSD 5.5 broke nanosleep in libc_r o threa/101323 threads fork(2) in threaded programs broken. o threa/103975 threads Implicit loading/unloading of libpthread.so may crash o threa/110636 threads using gdb with multi thread application with lib libpt 29 problems total. Non-critical problems S Tracker Resp. Description -------------------------------------------------------------------------------- s kern/19247 threads uthread_sigaction.c does not do anything wrt SA_NOCLDW s kern/22190 threads A threaded read(2) from a socketpair(2) fd can sometim s threa/30464 threads pthread mutex attributes -- pshared s threa/37676 threads libc_r: msgsnd(), msgrcv(), pread(), pwrite() need wra s threa/40671 threads pthread_cancel doesn't remove thread from condition qu s threa/69020 threads pthreads library leaks _gc_mutex o threa/79887 threads [patch] freopen() isn't thread-safe o threa/80992 threads abort() sometimes not caught by gdb depending on threa o threa/81534 threads [libc_r] [patch] libc_r close() will fail on any fd ty o threa/110306 threads apache 2.0 segmentation violation when calling gethost 10 problems total. From owner-freebsd-threads@FreeBSD.ORG Mon Apr 16 19:09:57 2007 Return-Path: X-Original-To: freebsd-threads@freebsd.org Delivered-To: freebsd-threads@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B7E0216A400 for ; Mon, 16 Apr 2007 19:09:57 +0000 (UTC) (envelope-from kabaev@gmail.com) Received: from an-out-0708.google.com (an-out-0708.google.com [209.85.132.242]) by mx1.freebsd.org (Postfix) with ESMTP id 7179D13C448 for ; Mon, 16 Apr 2007 19:09:57 +0000 (UTC) (envelope-from kabaev@gmail.com) Received: by an-out-0708.google.com with SMTP id c24so1963396ana for ; Mon, 16 Apr 2007 12:09:56 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:date:from:to:cc:subject:message-id:in-reply-to:references:x-mailer:mime-version:content-type; b=d2Afpax9zdNfffezKbnANdCWoaPgccA8rGwIwQZOdySBkUZcO5wuB+kfC1jWiY7LYR08apdvJIEfm4zSdzpJWhoabhM9TpMkGyAO0wce5mR7CT3/OPsdeAmtXMOQTL9MxOtFdQEENOxTFNMPcngwPwm6A7PyH9lzHc+pFbF6Ro4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:date:from:to:cc:subject:message-id:in-reply-to:references:x-mailer:mime-version:content-type; b=U+EbymfGyAE0FypTWSRWQR5fcIBwCydH+JaMQwsy5lv225fr2xk8rdskqDKQuAPyq8UA4uSctlTmvD+nw6rhz/feWkdNWiKHBnr/RCVOzzHPKx9fMkru0/xhoBPJiNBRqX82lks23qK0ghRqoAXqMPzxe6MSljgRbkwzo3cDMGQ= Received: by 10.100.132.16 with SMTP id f16mr524522and.1176748913056; Mon, 16 Apr 2007 11:41:53 -0700 (PDT) Received: from kan.dnsalias.net ( [24.34.98.164]) by mx.google.com with ESMTP id 3sm2152005wrs.2007.04.16.11.41.52; Mon, 16 Apr 2007 11:41:52 -0700 (PDT) Date: Mon, 16 Apr 2007 14:41:46 -0400 From: Alexander Kabaev To: Manoj Message-ID: <20070416144146.4cccd892@kan.dnsalias.net> In-Reply-To: <000001c77fee$76de69a0$6495460a@china.huawei.com> References: <000001c77fee$76de69a0$6495460a@china.huawei.com> X-Mailer: Claws Mail 2.8.1 (GTK+ 2.10.11; i386-portbld-freebsd7.0) Mime-Version: 1.0 Content-Type: multipart/signed; boundary=Sig_gRiI63YkkGu+eCACNFws1yN; protocol="application/pgp-signature"; micalg=PGP-SHA1 Cc: freebsd-threads@freebsd.org Subject: Re: "sleep" "select" system call not work correctly when linking with pthread in linux...................... X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Apr 2007 19:09:57 -0000 --Sig_gRiI63YkkGu+eCACNFws1yN Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable On Mon, 16 Apr 2007 14:14:17 +0800 Manoj wrote: > HI=20 >=20 > =20 >=20 > Can I know, as to why the select system call has problem, when we > link it with thread library. First, I would like to point out that FreeBSD project was historically short on psychic power and our developers are unable to extract the definition of 'problem' directly from your brain. They are forced to rely on people to actually tell them what the problem is. =20 > I use the same in my code. The response is not consistent. So can you > please provide more information on this. Same here. Before information can be provided to you, it would be nice to have something from you. "The response is not consistent" is hardly enough to go on. -- Alexander Kabaev --Sig_gRiI63YkkGu+eCACNFws1yN Content-Type: application/pgp-signature; name=signature.asc Content-Disposition: attachment; filename=signature.asc -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.7 (FreeBSD) iD8DBQFGI8NrQ6z1jMm+XZYRAuP7AKDN6VezpFskIv4hjgbwDZ94HnA9EQCdHwP4 U+AHoR7Kph+6rFQp6es3vXM= =KtjA -----END PGP SIGNATURE----- --Sig_gRiI63YkkGu+eCACNFws1yN-- From owner-freebsd-threads@FreeBSD.ORG Tue Apr 17 05:03:27 2007 Return-Path: X-Original-To: freebsd-threads@FreeBSD.org Delivered-To: freebsd-threads@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 5E17316A402; Tue, 17 Apr 2007 05:03:27 +0000 (UTC) (envelope-from mv@thebeastie.org) Received: from p4.roq.com (ns1.ecoms.com [207.44.130.137]) by mx1.freebsd.org (Postfix) with ESMTP id 376B013C44C; Tue, 17 Apr 2007 05:03:27 +0000 (UTC) (envelope-from mv@thebeastie.org) Received: from p4.roq.com (localhost.roq.com [127.0.0.1]) by p4.roq.com (Postfix) with ESMTP id 590624CDCA; Tue, 17 Apr 2007 04:33:03 +0000 (GMT) Received: from smitch7.jumbuck.com (p82.jumbuck.com [206.112.99.82]) by p4.roq.com (Postfix) with ESMTP id 2F28B4CDBF; Tue, 17 Apr 2007 04:33:03 +0000 (GMT) Received: from smitch7.jumbuck.com (mail.jumbuck.com [206.112.99.82]) by smitch7.jumbuck.com (Postfix) with ESMTP id B6CC34113E0; Tue, 17 Apr 2007 04:32:45 +0000 (UTC) Received: from beaste5.jumbuck.com (melbourne.jumbuck.com [150.101.166.27]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by smitch7.jumbuck.com (Postfix) with ESMTP id 53EE94112EA; Tue, 17 Apr 2007 04:32:45 +0000 (UTC) Received: from beaste5.jumbuck.com (beast5 [192.168.46.105]) by beaste5.jumbuck.com (Postfix) with ESMTP id BD4D6209D1A9; Tue, 17 Apr 2007 14:32:41 +1000 (EST) Received: from beast2.jumbuck.com (unknown [192.168.46.102]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by beaste5.jumbuck.com (Postfix) with ESMTP id 8F148209D195; Tue, 17 Apr 2007 14:32:41 +1000 (EST) Message-ID: <46244DE8.7010003@thebeastie.org> Date: Tue, 17 Apr 2007 14:32:40 +1000 From: Michael Vince User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.8.1.2) Gecko/20070314 SeaMonkey/1.1.1 MIME-Version: 1.0 To: freebsd-java@FreeBSD.org Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV using ClamSMTP Cc: freebsd-threads@FreeBSD.org Subject: Java and default libthr thread limits X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Apr 2007 05:03:27 -0000 Hi All, I been running Tomcat under FreeBSD 6.2 with libthr and I have noticed how easily we can hit 1,100 threads according to top right now, and we have hit past the default 1500 thread limit in the past. For me I am finding that this is just going higher to continue as the service is just getting busier. Currently I have just been increasing this manually via the sysctl. kern.threads.max_threads_per_proc: 40000 kern.threads.max_groups_per_proc: 40000 I was wondering if this limit should officially be increased to something like 5000 as my basic point of view is that if am easily hitting this limit then probably other people are as well. Any thoughts? Cheers, Mike From owner-freebsd-threads@FreeBSD.ORG Wed Apr 18 13:35:58 2007 Return-Path: X-Original-To: freebsd-threads@freebsd.org Delivered-To: freebsd-threads@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 171FE16A400 for ; Wed, 18 Apr 2007 13:35:58 +0000 (UTC) (envelope-from bounces@nabble.com) Received: from talk.nabble.com (www.nabble.com [72.21.53.35]) by mx1.freebsd.org (Postfix) with ESMTP id F047A13C45B for ; Wed, 18 Apr 2007 13:35:57 +0000 (UTC) (envelope-from bounces@nabble.com) Received: from [72.21.53.38] (helo=jubjub.nabble.com) by talk.nabble.com with esmtp (Exim 4.50) id 1HeA25-0007oL-Ev for freebsd-threads@freebsd.org; Wed, 18 Apr 2007 06:17:13 -0700 Message-ID: <10058476.post@talk.nabble.com> Date: Wed, 18 Apr 2007 06:17:13 -0700 (PDT) From: Arunachalam To: freebsd-threads@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Nabble-From: arunachalamp@huawei.com Subject: Regarding spawning X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Apr 2007 13:35:58 -0000 Hello, I need to add , linking of lc_r , for my application. But when i add this , i am unable to spawn a process in FreeBSD 5.4. I also linked against -lpthread also. Please say me if if my question is clear.... and let me know , what i am doing wrong Thanks, Arunachalam. -- View this message in context: http://www.nabble.com/Regarding-spawning-tf3600929.html#a10058476 Sent from the freebsd-threads mailing list archive at Nabble.com. From owner-freebsd-threads@FreeBSD.ORG Wed Apr 18 22:04:38 2007 Return-Path: X-Original-To: freebsd-threads@freebsd.org Delivered-To: freebsd-threads@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 0482F16A407 for ; Wed, 18 Apr 2007 22:04:38 +0000 (UTC) (envelope-from keramida@ceid.upatras.gr) Received: from igloo.linux.gr (igloo.linux.gr [62.1.205.36]) by mx1.freebsd.org (Postfix) with ESMTP id 62EE913C45D for ; Wed, 18 Apr 2007 22:04:37 +0000 (UTC) (envelope-from keramida@ceid.upatras.gr) Received: from kobe.laptop (host5.bedc.ondsl.gr [62.103.39.229]) (authenticated bits=128) by igloo.linux.gr (8.13.8/8.13.8/Debian-3) with ESMTP id l3IM45IA003746 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Thu, 19 Apr 2007 01:04:11 +0300 Received: from kobe.laptop (kobe.laptop [127.0.0.1]) by kobe.laptop (8.14.1/8.14.1) with ESMTP id l3IM3j7h036592; Thu, 19 Apr 2007 01:03:56 +0300 (EEST) (envelope-from keramida@ceid.upatras.gr) Received: (from keramida@localhost) by kobe.laptop (8.14.1/8.14.1/Submit) id l3IM3jfI036591; Thu, 19 Apr 2007 01:03:45 +0300 (EEST) (envelope-from keramida@ceid.upatras.gr) Date: Thu, 19 Apr 2007 01:03:45 +0300 From: Giorgos Keramidas To: Arunachalam Message-ID: <20070418220344.GA36558@kobe.laptop> References: <10058476.post@talk.nabble.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <10058476.post@talk.nabble.com> X-Hellug-MailScanner: Found to be clean X-Hellug-MailScanner-SpamCheck: not spam, SpamAssassin (not cached, score=-3.521, required 5, autolearn=not spam, ALL_TRUSTED -1.80, AWL 0.68, BAYES_00 -2.60, DNS_FROM_RFC_ABUSE 0.20) X-Hellug-MailScanner-From: keramida@ceid.upatras.gr X-Spam-Status: No Cc: freebsd-threads@freebsd.org Subject: Re: Regarding spawning X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Apr 2007 22:04:38 -0000 On 2007-04-18 06:17, Arunachalam wrote: > Hello, > I need to add , linking of lc_r , for my application. But when > i add this , i am unable to spawn a process in FreeBSD 5.4. > > I also linked against -lpthread also. > > Please say me if if my question is clear.... and let me know , > what i am doing wrong A minimal program which exhibits the failure, would be nice. Do you mean that when linking with -lc_r the fork() system call consistently fails all the time? Does it fail "some" times? - Giorgos From owner-freebsd-threads@FreeBSD.ORG Thu Apr 19 04:56:16 2007 Return-Path: X-Original-To: freebsd-threads@freebsd.org Delivered-To: freebsd-threads@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 9F17916A404 for ; Thu, 19 Apr 2007 04:56:16 +0000 (UTC) (envelope-from bounces@nabble.com) Received: from talk.nabble.com (www.nabble.com [72.21.53.35]) by mx1.freebsd.org (Postfix) with ESMTP id 8336113C48A for ; Thu, 19 Apr 2007 04:56:16 +0000 (UTC) (envelope-from bounces@nabble.com) Received: from [72.21.53.38] (helo=jubjub.nabble.com) by talk.nabble.com with esmtp (Exim 4.50) id 1HeOgp-0003Y7-St for freebsd-threads@freebsd.org; Wed, 18 Apr 2007 21:56:15 -0700 Message-ID: <10071680.post@talk.nabble.com> Date: Wed, 18 Apr 2007 21:56:15 -0700 (PDT) From: Arunachalam To: freebsd-threads@freebsd.org In-Reply-To: <20070418220344.GA36558@kobe.laptop> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Nabble-From: arunachalamp@huawei.com References: <10058476.post@talk.nabble.com> <20070418220344.GA36558@kobe.laptop> Subject: Re: Regarding spawning X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Apr 2007 04:56:16 -0000 Giorgos Keramidas wrote: > > On 2007-04-18 06:17, Arunachalam wrote: >> Hello, >> I need to add , linking of lc_r , for my application. But when >> i add this , i am unable to spawn a process in FreeBSD 5.4. >> >> I also linked against -lpthread also. >> >> Please say me if if my question is clear.... and let me know , >> what i am doing wrong > > A minimal program which exhibits the failure, would be nice. > > Do you mean that when linking with -lc_r the fork() system call > consistently fails all the time? Does it fail "some" times? > > - Giorgos > > Hello , > > Thanks for the reply. > > ya it is a minimal program. In the main, fork a process, in the child and > parent , just the debug statements. > > ya , it fails all the time if i link lc_r. > > But when i link with lthr, the problem is not there, means it is able to > spawn. > > Is that any problem with lc_r, can i use this lthr for my application. > > Thanks in advance, > Arunachalam. > _______________________________________________ > freebsd-threads@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-threads > To unsubscribe, send any mail to "freebsd-threads-unsubscribe@freebsd.org" > > -- View this message in context: http://www.nabble.com/Regarding-spawning-tf3600929.html#a10071680 Sent from the freebsd-threads mailing list archive at Nabble.com. From owner-freebsd-threads@FreeBSD.ORG Thu Apr 19 05:43:17 2007 Return-Path: X-Original-To: freebsd-threads@freebsd.org Delivered-To: freebsd-threads@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D73A716A409 for ; Thu, 19 Apr 2007 05:43:17 +0000 (UTC) (envelope-from deischen@freebsd.org) Received: from mail.ntplx.net (mail.ntplx.net [204.213.176.10]) by mx1.freebsd.org (Postfix) with ESMTP id 9B39513C4BB for ; Thu, 19 Apr 2007 05:43:17 +0000 (UTC) (envelope-from deischen@freebsd.org) Received: from sea.ntplx.net (sea.ntplx.net [204.213.176.11]) by mail.ntplx.net (8.14.0/8.14.0/NETPLEX) with ESMTP id l3J5hGrw009832; Thu, 19 Apr 2007 01:43:16 -0400 (EDT) X-Virus-Scanned: by AMaViS and Clam AntiVirus (mail.ntplx.net) X-Greylist: Message whitelisted by DRAC access database, not delayed by milter-greylist-3.0 (mail.ntplx.net [204.213.176.10]); Thu, 19 Apr 2007 01:43:16 -0400 (EDT) Date: Thu, 19 Apr 2007 01:43:16 -0400 (EDT) From: Daniel Eischen X-X-Sender: eischen@sea.ntplx.net To: Arunachalam In-Reply-To: <10071680.post@talk.nabble.com> Message-ID: References: <10058476.post@talk.nabble.com> <20070418220344.GA36558@kobe.laptop> <10071680.post@talk.nabble.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: freebsd-threads@freebsd.org Subject: Re: Regarding spawning X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Daniel Eischen List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Apr 2007 05:43:17 -0000 On Wed, 18 Apr 2007, Arunachalam wrote: >> Hello , >> >> Thanks for the reply. >> >> ya it is a minimal program. In the main, fork a process, in the child and >> parent , just the debug statements. >> >> ya , it fails all the time if i link lc_r. >> >> But when i link with lthr, the problem is not there, means it is able to >> spawn. >> >> Is that any problem with lc_r, can i use this lthr for my application. You need to provide a sample program. There is little useful information in what you provide above. Also, the only purpose for forking from a multithreaded process is to exec() another program. See the POSIX spec for more information. The only functions you can call from the child, aside from the exec() family of functions, are async-signal-safe functions. The behavior when calling any other functions is undefined according to POSIX. libc_r, libpthread, and probably to some extent libthr will have undefined behavior if used in this manner. -- DE From owner-freebsd-threads@FreeBSD.ORG Fri Apr 20 00:32:56 2007 Return-Path: X-Original-To: freebsd-threads@freebsd.org Delivered-To: freebsd-threads@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 630B116A40A for ; Fri, 20 Apr 2007 00:32:56 +0000 (UTC) (envelope-from andjones@gmail.com) Received: from wr-out-0506.google.com (wr-out-0506.google.com [64.233.184.225]) by mx1.freebsd.org (Postfix) with ESMTP id 2783113C45B for ; Fri, 20 Apr 2007 00:32:56 +0000 (UTC) (envelope-from andjones@gmail.com) Received: by wr-out-0506.google.com with SMTP id 70so804074wra for ; Thu, 19 Apr 2007 17:32:55 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:mime-version:content-type; b=Jqkj2VUgbj54OGdvDF9x2aHXiU3F91LBGFNxXI/oAR9v9DWRfUExOsW2o+RVbdtRtPRiw+eZz/8LPVoZS7rQ52TVUZcV74THOEv6sVYpyXn6pR1+JeNL4iO6szL9SSXSKaX6YnzanoG7045ZCOT3dNCJdomk91WrXGivtKNgR5w= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:mime-version:content-type; b=pgURiGUAd3KrJ1ijSmRn1COUm5BQf6w1dRuCoZLlOcTZh9cfkrTaEOwsAksf0r2CpgP+n6aoNJ70pxF5wHJk5dTA7dLRIA1t7/yhgYvTqHv3lJt4fiTO/DlaPSYf9jBOJOr+vRrn2JLvhm/xqaUoNtSPsn1MKJ83fOv9Y8og744= Received: by 10.115.78.1 with SMTP id f1mr1000772wal.1177027614818; Thu, 19 Apr 2007 17:06:54 -0700 (PDT) Received: by 10.114.160.5 with HTTP; Thu, 19 Apr 2007 17:06:54 -0700 (PDT) Message-ID: <86992cb10704191706p1f7fbc87mc08d0b661b90a15e@mail.gmail.com> Date: Thu, 19 Apr 2007 20:06:54 -0400 From: "Andy Jones" To: freebsd-threads@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Subject: Question about kse_switchin and TD_CAN_UNBIND X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Apr 2007 00:32:56 -0000 I'm curious about the meaning of the TDP_CAN_UNBIND flag being set on a thread (in its td_pflags) (see sys/proc.h). What does it mean that a thread "can unbind"? Second, why it is important that it is not set in kse_switchin (see kern/kern_kse.c) . (The answer to second question will probably become obvious with the answer to the first). -andy jones From owner-freebsd-threads@FreeBSD.ORG Fri Apr 20 01:26:34 2007 Return-Path: X-Original-To: freebsd-threads@freebsd.org Delivered-To: freebsd-threads@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C6D3A16A400 for ; Fri, 20 Apr 2007 01:26:34 +0000 (UTC) (envelope-from julian@elischer.org) Received: from outO.internet-mail-service.net (outO.internet-mail-service.net [216.240.47.238]) by mx1.freebsd.org (Postfix) with ESMTP id B693113C45B for ; Fri, 20 Apr 2007 01:26:34 +0000 (UTC) (envelope-from julian@elischer.org) Received: from mx0.idiom.com (HELO idiom.com) (216.240.32.160) by out.internet-mail-service.net (qpsmtpd/0.32) with ESMTP; Thu, 19 Apr 2007 17:54:38 -0700 Received: from [10.251.22.38] (nat.ironport.com [63.251.108.100]) by idiom.com (Postfix) with ESMTP id 29761125ADB; Thu, 19 Apr 2007 18:26:34 -0700 (PDT) Message-ID: <462816CD.3000101@elischer.org> Date: Thu, 19 Apr 2007 18:26:37 -0700 From: Julian Elischer User-Agent: Thunderbird 1.5.0.10 (Macintosh/20070221) MIME-Version: 1.0 To: Andy Jones References: <86992cb10704191706p1f7fbc87mc08d0b661b90a15e@mail.gmail.com> In-Reply-To: <86992cb10704191706p1f7fbc87mc08d0b661b90a15e@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-threads@freebsd.org Subject: Re: Question about kse_switchin and TD_CAN_UNBIND X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Apr 2007 01:26:34 -0000 Andy Jones wrote: > I'm curious about the meaning of the TDP_CAN_UNBIND flag being set on a > thread (in its td_pflags) (see sys/proc.h). What does it mean that a thread > "can unbind"? Second, why it is important that it is not set in > kse_switchin > (see kern/kern_kse.c) . (The answer to second question will probably become > obvious with the answer to the first). Firstly the names may be slightly misleading as the flags have remained even though the underlying implementation changed. TDP stands for TD (thread) (Private flag)_ CAN_UNBIND. Private means that no other thread should change this flag so it need not be locked. "CAN_UNBIND" indicates that when this thread entered the kernel, all the conditions were met to allow this thread to sleep waiting for some resource, and for it's upcall context structure (struct upcall) should be given to a new thread, so that another user thread could be run in its place. If this is not set then no replacement thread is sent to userland to continue working in the place of this sleeping thread, and the process as a whole will lose the use of one CPU (If it only ha sone CPU it will be stopped) until the thread wakes up again. It IS sometimes not set deliberatly. For example, when there are no more runnable user threads, the User Thread Scheduler (UTS) will sleep (actually do a kse_release()) in a way that disables the returning thread. (Since it has no work for it to do). The "UNBIND" in question is the detaching of the upcall structure from the thread. The upcall structure contains all the information and needed for the kernel thread to return to userland, and one could consider that being bound to it is a requirement for the user thread to proceed back to user space when it has woken up. If it doesn't have it when it wakes up, it will "piggy back" to user space on another thread, by dint of having its context written back to user space. The Userspace Thread Scheduler will then run it when another thread yields the processor, or returns from the kernel, and notices that the original thread has completed. A thread that does not have all the prerequisites for unbinding from its upcall structure "CAN NOT UPCALL" (hence the name), and so it will jsut sleep as per normal, keeping its upcall structure with it, so that the process as a whole loses the use of it. Each "Upcall" structure defines a UTS context that the kernel knows about, that can be used to run a user thread. All this is of course only true for KSE (M:N) threading. > > -andy jones > _______________________________________________ > freebsd-threads@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-threads > To unsubscribe, send any mail to "freebsd-threads-unsubscribe@freebsd.org"