[Mono-devel-list] C# Threading : libgcc_s.so.1 must be installed for pthread_cancel to work

prashanth.kalvala at wipro.com prashanth.kalvala at wipro.com
Thu Jun 23 08:30:16 EDT 2005


Hi,

We have mono 1.1.7 installed on Redhat Linux version 9.0. We have implemented a basic threading code in C#. The code is attached at the end of the mail.

The output of the code is as follows:

The Main() thread calls this after starting the new InstanceCaller thread.
The Main () thread calls this after starting the new StaticCaller threads.
You are Back in InstanceMethod.Running on Thread A

libgcc_s.so.1 must be installed for pthread_cancel to work

We get an error something related to pthread_cancel.

We wrote a sample code in C which invokes pthread_cancel. The program works fine.

We have the following under our PATH and LD_LIBRARY_PATH respectively

/usr/bin:/usr/bin:/usr/bin:/usr/bin:/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/X11R6/bin:/lib:/usr/lib:.

.:/usr/tibco/tibrv/lib:/lib:/usr/lib

we have libgcc_s.so.1 already installed.

Please suggest us what we need to do.

Best Regards
Prashanth Kalvala

-----------
Thread.cs
-----------
using System;

using System.Threading;

namespace Test

{

        public class Simple

        {



                // The method that will be called when the thread is started.

                public void InstanceMethod()

                {

                        try

                        {

                                // Pause for a moment to provide a delay to make threads more apparent.

                                Thread. Sleep(3000);

                                Console.WriteLine ("You are Back in InstanceMethod.Running on Thread A");

                              

                        }

                        catch(Exception ex)

                        {



                                Console.WriteLine ("asdasdadasd");

                        }



                      

                }



                public static void StaticMethod()

                {

                        Console.WriteLine("You are in StaticMethod. Running on Thread B.");

                        // Pause for a moment to provide a delay to make threads more apparent.

                        Console.WriteLine("Thread B Going to Sleep Zzzzzzzz");



                        Thread.Sleep(5000);

                        Console.WriteLine("You are back in static method. Running on Thread B");

                }



                public void Run()

                {



                        // Create the thread object, passing in the

                        // serverObject.InstanceMethod method using a ThreadStart delegate.

                        Thread InstanceCaller = new Thread(new ThreadStart(InstanceMethod));



                        // Start the thread.

                        InstanceCaller.Start();



                        Console.WriteLine("The Main() thread calls this " +  "after starting the new InstanceCaller thread.");

                }







                public static int Main(String[] args)

                {

                        Console.WriteLine ("Thread Simple Sample");   

                      

                        new Simple().Run();



                        // Create the thread object, passing in the

                        // serverObject.StaticMethod method using a ThreadStart delegate.

                        //Thread StaticCaller = new Thread(new ThreadStart(ServerClass.StaticMethod));

                        // Start the thread.

                        //StaticCaller.Start();

                        Console.WriteLine("The Main () thread calls this " + "after starting the new StaticCaller threads.");

                        return 0;

                }

        }

}





Confidentiality Notice

The information contained in this electronic message and any attachments to this message are intended
for the exclusive use of the addressee(s) and may contain confidential or privileged information. If
you are not the intended recipient, please notify the sender at Wipro or Mailadmin at wipro.com immediately
and destroy all copies of this message and any attachments.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-devel-list/attachments/20050623/e8fe9a11/attachment.html 


More information about the Mono-devel-list mailing list