Skip to contentSkip to conversation

Pthreads on Windows

Openvpn-devel James Yonan 2 participants 2 messages Dec 3, 2003 1 message not in the archive

lore
Share & tools
lore
#1 lore raw
In reply to a message not in the archive
Quoted 2 lines · Gisle Vanem

Is using USE_PTHREAD any points for Windows version of openvpn? If not, it should perhaps cause an "#error".

Good idea.

Quoted 3 lines

It doesn't compile because of missing 'reads' in 'struct event_wait'.

OpenVPN 1.5.0 + gcc MingW.

Pthreads doesn't work on Windows. Windows has its own threading model and is incompatible with pthreads.

Quoted 2 lines

BTW. My DDK doesn't have ntstrsafe.h. Isn't there a way to build the tap w/o that? (normal str*() functions).

Not really advised, as it may create buffer overflow vulnerabilities in the driver. The DDKs for Win2k and up should have ntstrsafe.h

James

#2 lore raw
Quoted 2 lines · James Yonan

Pthreads doesn't work on Windows. Windows has its own threading model and is incompatible with pthreads.

Not so. There is pthread-win32 at
http://sources.redhat.com/pthreads-win32/

I've successfully used it in libpcap etc. But OpenVPN uses native Windows calls, so using pthreads-win32 would add unneeded overhead (allthough very little).

--gv