Search:

Type: Posts; User: Anom

Search: Search took 0.00 seconds.

  1. Replies
    7
    Views
    3,355

    I finally figured it out after several days of...

    I finally figured it out after several days of being stumped. The problem was that FILE *file was declared globally, not locally in the thread.
  2. Replies
    7
    Views
    3,355

    Doesn't the first break break from the for-loop...

    Doesn't the first break break from the for-loop and hit pthread_mutex_unlock(&mutex1); immediately afterwards?
  3. Replies
    7
    Views
    3,355

    Stats waits on the count thread using...

    Stats waits on the count thread using pthread_cond_wait(). The count thread sends the signal to unlock the stats. There is a three part cycle going on between main, stats, and count:

    count waits...
  4. Replies
    7
    Views
    3,355

    Need Help: Multi-threading and Synchronization

    Everything in this program works perfectly except for one thing that I cannot figure out how to fix. I've spent hours rearranging code without success.

    There are 10 text files filled with random...
  5. Sorry I'm kind of new to mutual exclusion and...

    Sorry I'm kind of new to mutual exclusion and synchronization. I forgot how semaphores worked. I just got rid of the semaphore s2 in the count thread but it still deadlocks.

    I have the...
  6. It's been a couple hours now and I can't seem to...

    It's been a couple hours now and I can't seem to figure it out.

    Some of the indenting got messed up from the copy/pasting:



    /*
    This program will use multi-threading and synchronization to...
  7. pthread_cond_wait() is deadlocking entire program!

    The problem is that as soon as the stats thread is created, it locks the entire program, not just the stats thread itself. No other threads have a chance to get created because this thread is...
Results 1 to 7 of 7