From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fa528,c636cda4fa79bbaf X-Google-Attributes: gidfa528,public X-Google-ArrivalTime: 2003-10-09 11:51:43 PST Path: archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-04!sn-xit-06!sn-post-01!supernews.com!corp.supernews.com!not-for-mail From: "Ron Harter" Newsgroups: comp.unix.tru64 Subject: Re: pthread_kill problem????? Date: Thu, 09 Oct 2003 18:51:33 -0000 Organization: Posted via Supernews, http://www.supernews.com Message-ID: Sender: "Ron Harter" Reply-To: "Ron Harter" X-User-Info: 206.109.159.11 206.109.159.11 rharter References: X-Complaints-To: abuse@supernews.com Xref: archiver1.google.com comp.unix.tru64:24 The debugger says that program was executing in the pthread_kill function when it got an abort. This particular logic tests to see if a thread (a communication thread to clients) is in fact valid before attempting to queue an update packet to the thread to be sent down to a client. The client could have shitdown which would cause the thread to be deleted. Other threads receive data packets from other applications in the server and queue them to the communication threads where theya re transmitted to the client using CORBA middle ware. We need to be able to reliably determine if the communication thread is still available for use which is why we are calling pthread_kill(thread_id, 0) duane@alpha.zk3.dec.com (Andrew Duane USG) wrote: >In article "Ron Harter" writes: >>We are using pthread_kill(threadId, 0) to determine if a particular thread >>id is valid. We are running into a situation where the thread id (thread >>has been terminated and joined) >>is 0 and the program is getting an abort and core dumping. >> >>According to the documentation we should get back an ESRCH error, the program >>should not core dump. >> >>Has anyone else experinced problems in this area? WE are running Tru64 5.1b >>The task in question has approximatly 2000 threads >>and the kernal parameters are set to allow a max of 4096 threads. >> >>We have written a test driver that creates a dozen or so threads and checks >>them using pthread_kill(threadId, 0) with no problem, even after the thread >>exits and is joined so the threadId is 0. In this case a ESRCH is returned. > >I do not understand what is happening. Your application gets a core >dump when threadId is 0, but a test harness doesn't? > >Is there something else in your application that would dump when given >an errno of ESRCH? I have checked that pthread_kill does in fact return >ESRCH when threadId is 0, so I do not think that is the problem. > >Where does a debugger say your application dumped? > >-- > >Andrew L. Duane (JOT-7) duane@zk3.dec.com >HP/Compaq Corporation Andrew.Duane@compaq.com >110 Spit Brook Road Andrew.Duane@hp.com >M/S ZKO3-3/U14 >Nashua, NH 03062-2698 (603)-884-1294 > >