Thread: pthread and socket porting from Linux to Windows

  1. #1
    Alessio Stella
    Join Date
    May 2008
    Location
    Italy, Bologna
    Posts
    251

    pthread and socket porting from Linux to Windows

    Excuse me for my ignorance

    If i wanna port some pthread and socket C source code from Linux to Windows which are the most straight forward options?
    I still have to study that but:
    (1) Windows has a very different implementation of "socketing"?
    (2) Windows has a very different implementation of threads?
    (3) if the answer to (1) or (2) is "yes" or "quite": isn't there a probably less efficient but nice secundary version of socketing and/or threading for windows, more POSIX style? I think I found once an implementation of pthreads for windows: is it quite good?

    thank you

  2. #2
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    I beleive Windows sockets are pretty close to the BSD sockets used in Linux.

    Depending on what pthread features you need, you may be able to wrap the Windows/pthread implementations in fairly thinly for the use in your Windows app. But there may be some more work needed to translate some of the more complex parts of pthreads.

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  3. #3
    Deathray Engineer MacGyver's Avatar
    Join Date
    Mar 2007
    Posts
    3,210
    There exists a pthreads library for Windows I believe, floating about the Internet somewhere, so you might be ok not changing your threading implementation.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. The Pthread Hell
    By matott in forum Linux Programming
    Replies: 1
    Last Post: 04-10-2005, 05:59 AM