Solaris 8 -> Solaris 10 = problem :/


 
Thread Tools Search this Thread
Operating Systems Solaris Solaris 8 -> Solaris 10 = problem :/
# 1  
Old 03-28-2011
Solaris 8 -> Solaris 10 = problem :/

Hello,

I have a multithreading program (just two threads) which works on Solaris 8. I use pthread library to synchronize threads.
I try to run it on Solaris 10 (on another computer). All sources was re-compiled but behaviour of my program is not the same. The thread 2 is never executed when thread 1 is waiting.

example :
Code:
thread 1 beginning                       
                                             thread2 beginning
process
                                             process
process ...
... pthread_cond_wait(...);
(so thread waits a signal from thread 2)

but the program never come back to thread 2 whereas it works on Solaris 8.Smilie

Thanks in advance.
# 2  
Old 03-28-2011
Do both threads get started under Solaris 10, or just one of them? Are you mutexes and condition variables properly initialized?

What does truss show when you try to run your process? What does pstack show when your second thread isn't working right?

There were significant changes in the thread libraries in the migration from Solaris 8 to Solaris 10. If there's anything at all wrong with your code, something like this could happen all too easily, especially if you're moving from an early or unpatched version of Solaris 8 and/or Sun Studio.

Compiling and linking options can be critical, too. If your code is C++, read the CC documentation and pay particular attention to the "-mt" section of the man page.
# 3  
Old 03-29-2011
They start on the same OS (solaris 8 when it works, solaris 10 when it does'nt work).

Thread 1 (very simplification of source code) :
Code:
 
main_function {  /*(called every 20ms)*/
 
   (... some functions ...)
 
   pthread_mutex_lock(&mutexA);
   Read_data1;
   Read_data2;
   if (Status1)     {
      Status1=0;
      pthread_cond_wait(&synchroA,&mutexA);
   }
   else {
      pthread_cond_signal(&synchroB);
      Status2=1;
   }
   pthread_mutex_unlock(&mutexA);
 
   (... some functions ...)
 
   pthread_mutex_lock(&mutexA);
   Write_data3;
   Write_data4;
   if (Status2)     {
      Status2=0;
      pthread_cond_wait(&synchroA,&mutexA);
   }
   else {
      pthread_cond_signal(&synchroB);
      Status2=1;
   }
   pthread_mutex_unlock(&mutexA);
 
   Read_data5
}

Thread 2 is the same code with mutexB instead of mutexA, and synchroB instead of synchroA.

On Solaris 8 : no problem.
On Solaris 10 : On the first pthread_cond_wait (in thread 1 per example), program never returns to thread2 for mystery reasons.
# 4  
Old 04-24-2011
Hi Tinkh,

My guess: This might also not work on Solaris 8, if you set the concurrency level to at least 2.
Code:
   if (Status2)     {
      Status2=0;
      pthread_cond_wait(&synchroA,&mutexA);
   }
   else {
      pthread_cond_signal(&synchroB);
      Status2=1;
   }

Should'nt it be Status1=1 after the pthread_cond_wait() ?

HTH, Loïc
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Solaris

Solaris 10 problem - need help

I installed Solaris 10 on UltraSparc T5120. The machine shows yellow triagle ! LED. I got endless Warnings on console connection WARNING: /pci@0/pci@0/pci@1/pci@0/pci@1/pci@0/usb@0,2/hub@4/device@4/storage@0/disk@0,0 (sd6): Error for Command: read(10) Error Level: Fatal... (9 Replies)
Discussion started by: gping
9 Replies

2. Solaris

T3-2 and Solaris 10 Problem

Hi Guys, I got a unique (and wierd) problem with trying to install Solaris 10 off of a DVD on a T3-2. You boot cdrom, it goes through the questions and then when it comes to ask you if you want to install using nfs or dvd if you pick dvd it comes up with an error - ERROR: The disc you inserted... (8 Replies)
Discussion started by: callmebob
8 Replies

3. Solaris

Problem with Solaris 11.1 vm

Hi! I have the following problem: I tried to create a Solaris 11.1 virtual machine in the latest VMware Workstation (10.0.1) and despite my efforts it is impossible to make the Tools running. During the installation I receive the following messages: root@solaris:... (0 Replies)
Discussion started by: apollookc
0 Replies

4. Solaris

Solaris Problem

I have a SUnfire V120 solaris 10 machine I have recently added memory to. After installation of the RAM, powering back on, the machine did not come back on the network. Consoled into the machine, the routing table has been wiped out completely and I had to reconfigure the IP address. I got the IP... (12 Replies)
Discussion started by: lnxjenn
12 Replies

5. Solaris

Solaris 10 LU problem

I have a problem with export/home after doing the upgrade. The df -k shows /export and /export/home both being mounted on the same slice. Yes, both are in the vfstab file too. When I reformatted the disk for the upgrade, I added 10gb to the /export partition so that is the one I want to end up... (3 Replies)
Discussion started by: zeekstern
3 Replies

6. Solaris

Solaris 10 - X Problem

I can't get a remote X session to display on my Solaris 10 box. I can get it to work if I launch X on my local machine (like /usr/openwin/bin/xclock) so I know X itself is working correctly. The problem is, when I am on a remote host, I set the variable, and run /usr/openwin/bin/xclock, and it... (5 Replies)
Discussion started by: pc9456
5 Replies

7. Solaris

sendmail problem on Solaris 10

Hi All, I am facing problem while sending mail using "mail" & "sendmail" commands from my Solaris 10 system. When I send the mail, it moves it to dead.letter & generates following error messages in /var/log/syslog file; Feb 22 14:20:14 ppip1n sendmail: l1M8oDEE008601:... (10 Replies)
Discussion started by: jumadhiya
10 Replies

8. Solaris

Solaris 10 Jumpstart Problem

Hi, I build a jumpstart server with a running dhcp server. I already managed to install a x86 client via network. But my sparc clients aren't still working. When booting via network I get the following message: Timeout waiting for ARP/RARP packet I ran "snoop" on the server: client2 ->... (1 Reply)
Discussion started by: Jay_Fisi
1 Replies

9. UNIX for Dummies Questions & Answers

Problem with Solaris 9

I'm trying to install this on my pc at home but the thing is after I get to the option screen that ask where I want to boot solaris from: hard drive cd interface after I choose the cd option, it begins reading from the CD then it asks me if I want the installation to be interactive or... (3 Replies)
Discussion started by: TRUEST
3 Replies

10. UNIX for Dummies Questions & Answers

problem in solaris 8

hi, I have install solaris 8 7/01 in ULTRA 10,but when I type commands such like "admintool" and "swtool",there will be a error messege: warning:Missing charsets in string to fontset conversion arithmetic exception - core dumped I dont know what these mean,can anyone help me?thank... (1 Reply)
Discussion started by: fuqiang1976
1 Replies
Login or Register to Ask a Question