Help with THREADS

Help with THREADS

Post by Joshua Pincu » Tue, 07 Jul 1998 04:00:00



Hello,

Does anyone know if there is a POSIX-compliant threads package available
for FreeBSD?  I took a look at the pthreads packages that are available
from FSU and MIT.  Both libraries provide user-level threads, mutexes, etc.,
but there is no implementation of POSIX semaphores.

I need access to POSIX semaphores in order to get my work off the ground.

Any help or advice would be greatly appreciated.

JP
--
Joshua Pincus
UNIX Programmer
University of Rochester Computing Center
Rochester, New York 14627

 
 
 

Help with THREADS

Post by Tom Marchan » Thu, 09 Jul 1998 04:00:00


I tried to compile a simple pthreads program but the linker could not
find the thread functions.  I proceded to do a
"nm /usr/lib/*.a |grep pthread_create" and failed to locate the
library.  Granted I didn't spend much time searching other posiable
directory locations.

> Hello,

> Does anyone know if there is a POSIX-compliant threads package available
> for FreeBSD?  I took a look at the pthreads packages that are available
> from FSU and MIT.  Both libraries provide user-level threads, mutexes, etc.,
> but there is no implementation of POSIX semaphores.

> I need access to POSIX semaphores in order to get my work off the ground.

> Any help or advice would be greatly appreciated.

> JP
> --
> Joshua Pincus
> UNIX Programmer
> University of Rochester Computing Center
> Rochester, New York 14627


 
 
 

Help with THREADS

Post by Mark Tingue » Thu, 09 Jul 1998 04:00:00




Quote:>I tried to compile a simple pthreads program but the linker could not
>find the thread functions.  I proceded to do a
>"nm /usr/lib/*.a |grep pthread_create" and failed to locate the
>library.  Granted I didn't spend much time searching other posiable
>directory locations.

there is the old threads package that needs to be compiled/installed:

# cd /usr/src/lib/libc_r
# make all install

to compile add -lc_r to your final cc statement. see "man 3 pthread"

there is the MIT threads package:

        http://www.mit.edu:8001/people/proven/pthreads.html

there is the patched MIT pthreads at:

        http://www.humanfactor.com/pthreads/

The libc_r uses most of the libc and adds uthread routines, where
the MIT and PMPThreads re-implement the libc routines...some of the
re-implemented libc routines, IMO, are older than the libc versions.

the original poster is correct the MIT, and PMPThread implementaions
only implement SEMAPHORE_TEST_AND_SET and SEMAPHORE_RESET functions,
not the expected sem_* functions.

--mark.

 
 
 

1. HELP: Linux thread inside a thread ...

Hi,

I am new to thread programming & socket programming, and I really need
help in this.

I have create a thread (threadA), and inside this thread, I create another
thread (threadB). threadA is listening to a port for any incoming request.
Whenever there is an incoming request, it will create a thread (threadB)
to accept the request, and keep monitoring for any incoming data. I have
use the select() to detect for any data, and use ioctl(socket, FIONBIO,
&one) to make the recv() unblocked. However, when I run my program, I find
that when threadB is created, threadB is running all the time, and threadA
does not get its chance to run at all!!! This prevents threadA to accept
any new incoming request!!!

So how can I make threadA and threadB to be running at the same time (i.e.
share the CPU time)?? I really appreciate any help & suggestions.

I am using Linux, using the glibc-2.0.5 with linuxthread.

Thank you.

2. Gnu Tar (1.11.2) handling sparse files

3. Help on thread

4. IDE and scsi hard disks on one CPU

5. + Help with threads on Solaris 2.4 +

6. IRC Server wanted

7. help synchronizing threads....

8. VAX VMS shell for Unix?

9. help: java threads on multi-cpu

10. Help with thread, register stuff

11. help with threads

12. Help: Kernel thread wakes up too late

13. help simple threads program