Click to See Complete Forum and Search --> : Linux Problems


Kohinoor24
October 23rd, 2002, 03:11 PM
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..

Yves M
October 23rd, 2002, 03:16 PM
[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.

PaulWendt
October 23rd, 2002, 04:03 PM
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.

Kohinoor24
October 25th, 2002, 06:14 AM
Thanks....