Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I install pthreads on Debian?

Tags:

php

pthreads

Suprisingly, I can't find this anywhere. I'm trying to use the php Thread class. To do this I have to install pthreads.

How do I install pthreads on Debian 8?

like image 286
beznez Avatar asked Jun 09 '15 20:06

beznez


People also ask

Where is Pthread library in Linux?

The pthreads run time library usually lives in /lib, while the development library usually lives in /usr/lib.

How do I add a Pthread library?

Project properties -> in C/C++ Build -> Settings -> Tool Settings tab -> In GCC C Linker -> Libraries -> add "pthread" there and enjoy. Hope this help.

How is pthreads implemented?

Pthreads are implemented as user threads by the runtime library. Most portable implementation since it requires no kernel support. Fast context switches between user threads because it is handled entirely in user space without the overhead of the kernel implementing a process-level context switch.


1 Answers

Pthreads is part of the libc6 package:

dpkg -L libc6 | grep pthread
/lib/arm-linux-gnueabihf/libpthread-2.19.so
/lib/arm-linux-gnueabihf/libpthread.so.0

You might need need libc6-dev if you are compiling stuff:

dpkg -L libc6-dev | grep pthread
/usr/include/arm-linux-gnueabihf/bits/pthreadtypes.h
/usr/include/pthread.h
/usr/lib/arm-linux-gnueabihf/libpthread_nonshared.a
/usr/lib/arm-linux-gnueabihf/libpthread.so
/usr/lib/arm-linux-gnueabihf/libpthread.a
like image 74
mikewilliamson Avatar answered Oct 04 '22 21:10

mikewilliamson