Date: Mon, 9 Aug 1999 20:11:37 +0530 From: "Geeta Mahesh" <ugtech@bom3.vsnl.net.in> To: <questions@freebsd.org> Subject: pthreads on FreeBSD Message-ID: <003801bee275$4b045a20$030136ca@ugtech.com>
next in thread | raw e-mail | index | archive | help
This is a multi-part message in MIME format. ------=_NextPart_000_0035_01BEE2A3.62E47AC0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hi.=20 I am using pthreads in my application.=20 I am able to run a small sample program that creates a thread using = pthread_create=20 wherein the main program and the thread display a line of text. However, I find that the threading is not taking place when I run my = application which creates a thread=20 using pthread_create.=20 The main thread in my application listens for client connections on a = socket and signals a semaphore when there is a connection while the = thread runs in the background, waits on a semaphore and continues = execution when the semaphore is signaled. I see that either the main program executes or the thread executes.=20 Can you tell me what is going wrong? Regards Geeta ------=_NextPart_000_0035_01BEE2A3.62E47AC0 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML><HEAD> <META content=3D"text/html; charset=3Diso-8859-1" = http-equiv=3DContent-Type> <META content=3D"MSHTML 5.00.2314.1000" name=3DGENERATOR> <STYLE></STYLE> </HEAD> <BODY bgColor=3D#ffffff> <DIV><FONT size=3D2> <DIV><FONT size=3D2>Hi. </FONT></DIV> <DIV><FONT size=3D2>I am using pthreads in my application. </FONT></DIV> <DIV><FONT size=3D2>I am able to run a small sample program that creates = a thread=20 using pthread_create </FONT></DIV> <DIV><FONT size=3D2>wherein the main program and the thread display a = line of=20 text.</FONT></DIV> <DIV> </DIV> <DIV><FONT size=3D2>However, I find that the threading is not taking = place when I=20 run my application which creates a thread </FONT></DIV> <DIV><FONT size=3D2>using pthread_create. </FONT></DIV> <DIV> </DIV> <DIV><FONT size=3D2>The main thread in my application listens for client = connections on a socket and signals a semaphore when there is a = connection while=20 the thread runs in the </FONT><FONT size=3D2>background, waits on = a=20 semaphore and continues execution when the semaphore is = signaled.</FONT></DIV> <DIV> </DIV> <DIV><FONT size=3D2>I see that either the main program executes or the = thread=20 executes. </FONT></DIV> <DIV> </DIV> <DIV><FONT size=3D2>Can you tell me what is going wrong?</FONT></DIV> <DIV><FONT size=3D2>Regards</FONT></DIV> <DIV><FONT size=3D2>Geeta</FONT></DIV></FONT></DIV></BODY></HTML> ------=_NextPart_000_0035_01BEE2A3.62E47AC0-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?003801bee275$4b045a20$030136ca>