CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4

Thread: Linux Problems

  1. #1
    Join Date
    Oct 2001
    Posts
    745

    Linux Problems

    Iam working on a multithreaded application running under Linux.
    Iam using caldera Compiled GNU compiler 3.1.4.While running the application,Iam Getting a segmentation Fault.
    I have the following questions to ask

    [1]When will be these kinds of segmentation faults coming.
    [2]Is Linux libraries stable enough to run multithreaded.Which versions of libraries are needed.
    [3]Are the Linux libraries Thread safe.
    [4]Is it worthy enough to make an aplication under Linux multithreaded.If not,What are the reasons.

    Hoping that someone will come out with answers.
    Thanks..

  2. #2
    Join Date
    Aug 2002
    Location
    Madrid
    Posts
    4,588
    [1]Segmentation faults are usually a consequence of you trying to access memory that doesn't belong to you.
    [2]Yes it is stable enough, otherwise people wouldn't use it in supercomputers
    [3]Difficult to answer and my *guess* would be that some functions are thread-safe, while others aren't.
    [4]It depends on your application. But that's pretty much the same reasoning for most OSes. For a server handling multiple requests, it makes sense. For a program that does heavy calculations it makes sense.

  3. #3
    Join Date
    May 2000
    Location
    Phoenix, AZ [USA]
    Posts
    1,347
    Your questions seem to want to find a way to distance your
    application from multi-threading. As Yves suggested, there may
    very well be a good reason to use multi-threading. So, try to
    find out where your error is ... and fix it. You'll have to do some
    debugging and find out exactly where your program is crashing.
    Once you have figured out where it crashes, then you must
    figure out WHY it crashes. Once you know these two things,
    fixing your problem should be straight-forward. One of the most
    common errors when dealing with multi-threaded programs is
    two threads accessing one resource simultaneously. In other
    words, make sure you're protecting all shared resources with
    locks, mutexes, or whatever your thread library's library
    mechanism is.

  4. #4
    Join Date
    Oct 2001
    Posts
    745
    Thanks....

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