pthread_exit 에서 wait 상태에서 풀리지 않습니다.

abwlts의 이미지

전문을 받아 쓰레드로 처리하는 프로그램입니다.
pthread_exit 에서 wait 상태에서 풀리지 않습니다.
OS는 AIX5.3입니다.

아래는 dbx를 떠본 결과입니다.
여기 저기 찾아봤지만, 딱 들어맞는 결과를 찾기는 힘드네요.
전문가님들의 조언 구합니다.

# dbx -a 1753222

(dbx) thread
$t1 wait 0xf10006000126ea08 running 10657877 k no pro main
$t211857 runnable u no pro _usched_swtch
$t210510 wait 0x09001000a02a86b0 running 9392205 k no pro _event_notify
$t210752 wait 0x09001000a02a9460 running 3207371 k no pro _event_notify
$t210753 wait 0x00000001100126d8 blocked 9117809 k no pro _usched_dispatch_front
$t211271 wait 0x09001000a02a9840 running 3481713 k no pro _event_notify
$t211936 wait 0x09001000a02a6e40 running 6775035 k no pro pthread_exit
$t210754 wait 0x09001000a02a8580 running 10604603 k no pro _event_notify
$t211119 wait 0x09001000a02a7f70 running 5161195 k no pro _event_notify
$t211683 wait 0x00000001100126d8 blocked 6025361 k no pro _usched_dispatch_front
$t211012 wait 0x09001000a02a6e40 running 8294603 k no pro pthread_exit
$t211013 wait 0x00000001100126d8 blocked 7503965 k no pro _usched_dispatch_front
$t211618 wait 0x09001000a02a81b0 running 4501583 k
(dbx) thread
$t1 wait 0xf10006000126ea08 running 10657877 k no pro main
$t211857 runnable u no pro _usched_swtch
$t210510 wait 0x09001000a02a86b0 running 9392205 k no pro _event_notify
$t210752 wait 0x09001000a02a9460 running 3207371 k no pro _event_notify
$t210753 wait 0x00000001100126d8 blocked 9117809 k no pro _usched_dispatch_front
$t211271 wait 0x09001000a02a9840 running 3481713 k no pro _event_notify
$t211936 wait 0x09001000a02a6e40 running 6775035 k no pro pthread_exit
$t210754 wait 0x09001000a02a8580 running 10604603 k no pro _event_notify
$t211119 wait 0x09001000a02a7f70 running 5161195 k no pro _event_notify
$t211683 wait 0x00000001100126d8 blocked 6025361 k no pro _usched_dispatch_front
$t211012 wait 0x09001000a02a6e40 running 8294603 k no pro pthread_exit
$t211013 wait 0x00000001100126d8 blocked 7503965 k no pro _usched_dispatch_front
$t211618 wait 0x09001000a02a81b0 running 4501583 k no pro _event_notify
$t211464 wait 0x09001000a02a6e40 running 5972151 k no pro pthread_exit
$t211832 wait 0x09001000a02a6e40 running 7737449 k no pro pthread_exit
:

int iSockFd;
 
void *Server( void *arg );
 
/*
* Function Name : main
* Argument : int argc, char *argv[]
* Return Value : int
* Description : Main Function
*/
int main( int argc, char *argv[] )
{
:
:
while( 1 )
{
:
:
 
iAcptFd = accept( iSockFd, &peeraddr_in, &iAdrLen );
 
:
:
 
if( pthread_create( &stTrdBuf.ptThread[iIndexN], NULL, Server, (void *)stAllocBuf ) )
{
LOGPUT( _FL_, 9, 0, "Thread Create Error=[%d]", errno );
LibFreeThreadContext( iIndexN );
free( stAllocBuf );
close( iAcptFd );
}
 
} /* end of while() */
 
} /* end of main() */
 
/*
* Function Name : Server
* Argument : void *arg( Socket Fd )
* Return Value : void *
* Description : Thread Create Server Function
*/
void *Server( void *arg )
{
:
:
 
pthread_detach( pthread_self() ); /* Thread 분리 */
 
:
:
 
close( iAcptFd ); if( sAllocBuf ) free( sAllocBuf );
 
if( LibFreeThreadContext( iIndexN ) ) /* iIndex 번째 Thread Free */
{
LOGPUT( _FL_, 9, 0, "LibFreeThreadContext Error=[%d]", errno );
}
 
pthread_exit( (void *)NULL );
 
} /* end of Server() */                                                              
dorado2의 이미지

pthread_exit( (void *)NULL )를 빼고도 테스트해보셨나요?

댓글 달기

Filtered HTML

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

BBCode

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param>
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

Textile

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • You can use Textile markup to format text.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Markdown

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • Quick Tips:
    • Two or more spaces at a line's end = Line break
    • Double returns = Paragraph
    • *Single asterisks* or _single underscores_ = Emphasis
    • **Double** or __double__ = Strong
    • This is [a link](http://the.link.example.com "The optional title text")
    For complete details on the Markdown syntax, see the Markdown documentation and Markdown Extra documentation for tables, footnotes, and more.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Plain text

  • HTML 태그를 사용할 수 없습니다.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 줄과 단락은 자동으로 분리됩니다.
댓글 첨부 파일
이 댓글에 이미지나 파일을 업로드 합니다.
파일 크기는 8 MB보다 작아야 합니다.
허용할 파일 형식: txt pdf doc xls gif jpg jpeg mp3 png rar zip.
CAPTCHA
이것은 자동으로 스팸을 올리는 것을 막기 위해서 제공됩니다.