I have noticed that there's a lot of multithreading libraries available for
POSIX compliant progs. Which of the existing libraries would you recommend
the best among the rest.
I haven't taken a look at all the libraries, anybody might have known them
all, please post a list.
Thanks!
markjeee
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of Joel Realubit
Sent: Friday, October 06, 2000 1:34 PM
To: [EMAIL PROTECTED]
Subject: Re: [plug] multithreading
mismo!
=)
Jolly Roger wrote:
>
> [EMAIL PROTECTED] wrote:
>
> >hi!
> >
> >with fork, you spawn a complete copy of the whole program and run it as
> >another process, which isn't exactly multithreading.
>
> You can call it heavyweight threads ;-)
>
> >if you do an exec,
> >you load another program (i think) and run it.
>
> Exec replaces your current process' address space with the new executable.
>
> >if you want to use true
> >multithreading, in which only part of your program is run as a separate
> >thread simultaneously with your main program, then you should use
> >pthreads instead of fork or exec. i dont have a reference handy with me
> >right now so i cant tell the exact syntax for using pthreads but it goes
> >something like:
> >
> > create_pthread( <worker function>, <parameter>, <other flags>);
>
> #include <pthread.h>
>
> int pthread_create(pthread_t * thread, pthread_attr_t *
> attr, void * (*start_routine)(void *), void * arg);
>
> Then link with -lpthread
>
> >the exact syntax may vary but the idea is the same. the worker function
> >is the function you want to execute in a thread, the <parameter> is of
> >course the parameter you want to pass to your function.
>
> HTH,
> JR
>
> _
> Philippine Linux Users Group. Web site and archives at
http://plug.linux.org.ph
> To leave: send "unsubscribe" in the body to [EMAIL PROTECTED]
_
Philippine Linux Users Group. Web site and archives at http://plug.linux.org.ph
To leave: send "unsubscribe" in the body to [EMAIL PROTECTED]