linux-c-programming.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Uday K Verma" <udayv@netsoftglobal.com>
To: 'MuthuKumar' <ramana_muthu@yahoo.co.in>,
	linux-c-programming@vger.kernel.org
Subject: RE: thread programming
Date: Fri, 2 Apr 2004 17:49:04 +0530	[thread overview]
Message-ID: <S263590AbUDBMTZ/20040402121925Z+476@vger.kernel.org> (raw)
In-Reply-To: <c4jk69$toj$1@sea.gmane.org>

I seriously believe you need a C programming book before you delve into
threads. 

Uday K Verma 
//

Hai All.

I have tried the basic thread program as

#include <stdio.h>
#include <pthread.h>
#include <errno.h>

void *fun()
{
        printf("Hai\n");
        pthread_exit((void *)8);
}

main()
{
pthread_t t[10];
int res,ret;
int i=0,loop=10;
for(i=0;i<loop;i++)
{
t[i]=(pthread_t)malloc(sizeof(pthread_t));
res=pthread_create(&t[i],NULL,fun,NULL);
ret=pthread_join(t[i],(void *)res);
free(t[i]);
}
}

Is it a good way of programming. Or any other effective to do this basic
program.

Thanks for the Reply!
--
Regards,
Muthukumar.



---
Status of a mail from <172.16.1.46 | 00-0B-CD-2A-98-69> Checked by AVG
anti-virus system (http://www.grisoft.com).
Version: 6.0.648 / Virus Database: 415 - Release Date: 3/31/2004



-
To unsubscribe from this list: send the line "unsubscribe
linux-c-programming" in the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

      reply	other threads:[~2004-04-02 12:19 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-04-02 11:52 thread programming MuthuKumar
2004-04-02 12:19 ` Uday K Verma [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=S263590AbUDBMTZ/20040402121925Z+476@vger.kernel.org \
    --to=udayv@netsoftglobal.com \
    --cc=linux-c-programming@vger.kernel.org \
    --cc=ramana_muthu@yahoo.co.in \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).