Jump to content

Alternate to pthread in windows

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
1 reply to this topic

#1
sourlemon

sourlemon

    Programmer

  • Members
  • PipPipPip
  • 99 posts
Hi guys,

I had to write a producer/consumer program for a class. I was able to get it to work correctly on unix, but I'm having trouble implementing it on Windows. I've used Dev++ to compile it, but it won't recognize my pthread library. I did downloaded the pthread.h into the directly. Is there a special way to compile it? Or is there an alternative I can use?

#2
TkTech

TkTech

    The Crazy One

  • Moderators
  • 1,396 posts
The pthread interface is *nix specifc. It is not available naitively on windows. Lookup 'CreateThread' on MSDN and work from there.

There is a port of pthreads to windows however I don't recommend you use it due to shady implementations of some functions.

I'd give you an example but mobile keyboards suck :(