Find the answer to your Linux question:
Results 1 to 2 of 2
Need some help with multi-threading. Basically I need to create a main that creates 2 threads. The 1 thread will read from one file and 2nd thread will read from ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Sep 2007
    Posts
    3

    Threads/Multi-threading


    Need some help with multi-threading. Basically I need to create a main that creates 2 threads. The 1 thread will read from one file and 2nd thread will read from the 2nd file (basically a file for each thread). The thread will begin reading characters from the file. If a thread encounters a space it will then call the second thread and the 2nd thread will be begin reading the 2nd file. This goes back and forth until both files have been completely read. I am new to threads and just a little confused. I am somewhat knowledgeable of pthread_create, pthread_cond_wait, pthread_exit, etc.. Maybe pseudocode a solution? Help is greatly appreciated.

    Thanks,

    David Wilks

  2. #2
    Linux Engineer RobinVossen's Avatar
    Join Date
    Aug 2007
    Location
    The Netherlands
    Posts
    1,429
    Hey, Id love to help yea.
    though I have never worked on the Linux Kernel.. (I know.. its bad..)
    But I have made serval C++ Programs that used Threading.
    So can I help you maybe?
    what do you exacly need?
    Since I dont really get ur question..

    I really hope I can help since I KNOW how anoying it is if you cant get replys in 3 hours.. so well If I can help reask your Question.

    Cheers
    - Robin
    New Users, please read this..
    Google first, then ask..

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •