Thread: threads (general)

  1. #1
    Registered User
    Join Date
    May 2003
    Posts
    38

    threads (general)

    Are POSIX threads only for Unix and Solaris machines or can they be run in the windows enviroment. Is this a good route to take for a multithreading application or would you recommend something else?
    chris

  2. #2
    It's full of stars adrianxw's Avatar
    Join Date
    Aug 2001
    Posts
    4,829
    Don't crosspost, it's against the rules. I already answered your first question in the other thread which I will now close.

    As for which is better, a pThreads library or the native threading model, there is no simple answer. If you know pThreads, then the learning curve to multithreading on Windows disappears, but since the library will be a wrapper around the native system of calls, there will be a performance hit which would not be there using the native model.
    Wave upon wave of demented avengers march cheerfully out of obscurity unto the dream.

  3. #3
    Registered User
    Join Date
    May 2003
    Posts
    38

    re

    Thanks for the response. I didn't relieze I was "double posting" I was just looking for other suggestions from the windows board like you mentioned, sorry and Thanks again.

    do you know a good source for general information on the "native" threading approach that you mentioned?
    chris

  4. #4
    It's full of stars adrianxw's Avatar
    Join Date
    Aug 2001
    Posts
    4,829
    >>> I didn't relieze I was "double posting"

    You're new, you've learnt. Good enough. There are a few board rules, they are posted at the top of each forum. They are basically common sense, and if you are sensible, you'll not find them restrictive.

    >>> good source for general information on the "native" threading

    Your ever available MSDN!

    If you are coming to Windows from a *NIX or Linux, it is worth browsing MSDN's library. It is huge, and sadly, not laid out terribly well, but it is updated frequently, and once you know how to navigate it, is a superb resource.

    I routinely multithread my apps, (always with Win32 functions), and so do a few other on this board. We try to please.

    (I have used pThreads on other platforms, so may be able to give you a shove in the right direction if you need the "Windows equivalent of" a pThreads call - however, the model is a little different, so not everything translates).
    Wave upon wave of demented avengers march cheerfully out of obscurity unto the dream.

  5. #5
    Guest Sebastiani's Avatar
    Join Date
    Aug 2001
    Location
    Waterloo, Texas
    Posts
    5,708
    Search this board, there is source code posted.
    Code:
    #include <cmath>
    #include <complex>
    bool euler_flip(bool value)
    {
        return std::pow
        (
            std::complex<float>(std::exp(1.0)), 
            std::complex<float>(0, 1) 
            * std::complex<float>(std::atan(1.0)
            *(1 << (value + 2)))
        ).real() < 0;
    }

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 5
    Last Post: 10-17-2008, 11:28 AM
  2. Yet another n00b in pthreads ...
    By dimis in forum C++ Programming
    Replies: 14
    Last Post: 04-07-2008, 12:43 AM
  3. Classes and Threads
    By Halloko in forum Windows Programming
    Replies: 9
    Last Post: 10-23-2005, 05:27 AM
  4. problem with win32 threads
    By pdmarshall in forum C++ Programming
    Replies: 6
    Last Post: 07-29-2004, 02:39 PM
  5. Block and wake up certain threads
    By Spark in forum C Programming
    Replies: 9
    Last Post: 06-01-2002, 03:39 AM