Search:

Type: Posts; User: dimis

Search: Search took 0.00 seconds.

  1. Replies
    14
    Views
    7,559

    Thanks. The #pragma definition was a savior. I...

    Thanks. The #pragma definition was a savior. I don't know what I was doing wrong on the linker project settings, but this certainly works. Thanks again. :) :good:
  2. Replies
    8
    Views
    3,737

    I wanted to measure time while using threads and...

    I wanted to measure time while using threads and I have some source code with which you can experiment here. Hope this helps.

    Check my second post there (third post on thread). That's the one you...
  3. Thread: prog wont work

    by dimis
    Replies
    3
    Views
    1,124

    Not only that. After else you should remove '()',...

    Not only that. After else you should remove '()', after the conditions on your if statements remove ';', and after randgetal = rand() insert an ';'.
    Now it will compile but you have no chance on...
  4. Replies
    14
    Views
    7,559

    win32 Pthreads

    Ok, a question with a different flavor.
    I have to port to windows a simple program that used pthreads. For this purpose, I think this is ideal. I followed the instructions found on faq (mainly...
  5. To be honest, my main concern was to print a...

    To be honest, my main concern was to print a message with the response time and not the cpu-time, so gettimeofday is exactly what I want. Still I don't see how you can measure the (sum of) time...
  6. Thanks matsp. I think that gettimeofday () is...

    Thanks matsp. I think that gettimeofday () is exactly what I want. In fact it has an intuitive name and it was silly I didn't look for it earlier. :)
    @brewbuck: I guess I don't get what you are...
  7. The program with various things I tested until I...

    The program with various things I tested until I found gettimeofday():

    Output:

    $ ./try 50000000
    Clock ticks per second: 100
    Just started counting!
    All threads joined!
    Duration 1: 12.0655...
  8. getrusage has the same trouble with clock ()....

    getrusage has the same trouble with clock (). [tested]
  9. solution

    Thanks Codeplug. However, these guys wanted to measure the time of each individual thread, which is not what I want. I figured out a solution though with gettimeofday () after searching for quite...
  10. Replies
    14
    Views
    7,559

    Thank you guys

    I don't know what to say. You are obviously right and I am obviously wrong. Justification soon. If I offended anyone I apologize; it was not my intention. Up until this post I made the mistake that...
  11. How to measure the time in multi-core machines with pthreads?

    After spending about an hour trying to figure out what was the problem that my threaded version of a program took more time than the single-core one, I think I rediscovered the wheel. Simply put, I...
  12. Replies
    14
    Views
    7,559

    I am not saying that more than one threads have...

    I am not saying that more than one threads have locked the mutex. :) I am saying that more than one may assume that they have locked the mutex. Read my quote from the manual.

    Wrong. The thread...
  13. Replies
    14
    Views
    7,559

    Now, on a second thought, I can solve all my...

    Now, on a second thought, I can solve all my (n00bish) ambiguities, by assigning a different queue to each "worker" and even use the 'if' statement version of the code. :)

    Still though, I am...
  14. Replies
    14
    Views
    7,559

    Still ...

    ... I don't get it. I already gave a "fake" example on how things might go wrong. The problem is that once at least 2 threads wake up, then all of them assume that the mutex is locked for them. Am I...
  15. Thread: Mac OS question

    by dimis
    Replies
    9
    Views
    2,465

    Bootcamp

    You can even use BootCamp with your Mac, install a minimal version of Windows just for compiling and creating executables, and you are done in *native* environment. :)
  16. Replies
    14
    Views
    7,559

    Yet another n00b in pthreads ...

    Hi,
    I am new in pthread library and perhaps my question is naive. Anyway, here is the problem I want to solve. I want to create N >= 2 threads and one of them (from now on "generator") will always...
Results 1 to 16 of 16