CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Dec 2005
    Posts
    1

    Question Problems when running several threads at the same time!!

    Hello everyone!
    I am currently working with threads and i have run into some problems. Namely, i have created a file from where i read data. One string reads the file and records latency time while the other threads simply read the same file(their purpose is to bother the recording string!!). When i run 10 strings everything is fine. I then increase the number of strings to 15 and i start getting problems. Some strings which are reading the file simply get cut off(in other words they never complete their reading of the entire file!!). Can someone help me with this please!! Thank you in advance

    Regards,
    Dubs

  2. #2
    Join Date
    Apr 2005
    Location
    Norway
    Posts
    3,934

    Re: Problems when running several threads at the same time!!

    Do you got that same problems if you run only one of the threads? Are the threads sharing one or more resources? Did you remember to synchronize access to those shared resources? It could be a race condition, but it's difficult to say without any source code.

    - petter

  3. #3
    Join Date
    May 2002
    Location
    Phoenix, AZ
    Posts
    95

    Re: Problems when running several threads at the same time!!

    Strings? I suppose you mean threads?
    Visit my blog on http://360.yahoo.com/raghupathys

    ------------------------------------------------------------------------------------------
    Do what you feel in your heart to be right, for you'll be criticized anyway.
    You'll be damned if you do and damned if you don't.
    - Eleanor Roosevelt

Posting Permissions

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





Click Here to Expand Forum to Full Width

Featured