Pthreads
The POSIX
1003.1-2001 standard defines an application programming interface (API)
for writing multithreaded applications. This interface is known more commonly
as pthreads. A
good number of modern operating systems include a threading library of some
kind
O objectivo desta página é de fornecer
materia sobre a programação usando a biblioteca de pthreads.
Exemplos serão adicionados mais tarde.
·
Lawrence
Livermore National Laboratory POSIX Threads Tutorial ou localcopy (html)
·
Getting
Started With POSIX Threads (University of Massachusetts ou localcopy (postscript)
·
Multi-Threaded Programming With
POSIX Threads ou localcopy
(html)
·
The Single Unix
Specification version 3 (IEEE Std 1003.1-2001) free online reference
·
comp.programming.threads
FAQ
·
Programming
POSIX threads Site muito interessante
·
comp.os.ms-windows.programmer.win32
Compilação numa maquina com o sistema operativo linux
devidamente instalado
cc –o nome nome.c –lpthreads
Exemplos das Aulas Teoricas
Win32 does not, and is unlikely to ever,
support pthreads natively. The Open Source
POSIX Threads for Win32
seeks to provide a freely available high-quality solution to this
problem. The code necesseray can ve found on the following site, http://sources.redhat.com/pthreads-win32/.
Obter ficheiro com formato
“pthreads-ano-mes-dia.exe”, por
exemplo a copia local pthreads-2003-09-04.exe,
(A versão mais recente pode ser obtido a partir do site em cima.) Descompactar,
Abrir workspace (será necessário o Microsoft Visual C++), Recompilar tudo.
Copiar dll e libs criados para um situio apropriado.
Opção 2
- Mais simples .. Obter ficheiro zip em baixo que contêm um
workspace, ficheioros exemplos .c e os ficheiros .lib e .dll do pthreads já
configurados .. e boa sorte geral.zip
Common Problemas.
Compiler error : “Cannot open
include file: “pthread.h'” à project
settings/ c++/preprocessor/all configs/additional include directorys
Build error : project
settings/ link/ input/all configs / additional library path … Object / library modules
Run Time error “can Not find
dll” : copy the “dll” to the system32/dll-cache directory
or to the directory from where the executable will be executed.