Author Topic: POSIX Threads  (Read 1144 times)

0 Members and 1 Guest are viewing this topic.

Offline pomprockerTopic starter

  • Supreme Robot
  • *****
  • Posts: 1,430
  • Helpful? 16
  • Sorry miss, I was giving myself an oil-job.
POSIX Threads
« on: January 25, 2010, 04:28:16 PM »
Do any of you C experts have any experience with pthreads or GNU pth??

I'm trying to cross compile and voice control program 'cvoicecontrol' on a linux ppc type machine...

Offline rgcustodio

  • Robot Overlord
  • ****
  • Posts: 217
  • Helpful? 0
  • Use "Search" and ye might find answers!
Re: POSIX Threads
« Reply #1 on: January 25, 2010, 04:49:57 PM »
I am by no means an expert but I'll to help.

Your BSP (board support package, if you have one) or your toolchain should provide a compiled pthreads library.

IIRC, POSIX threads have been integrated into gcc a long long time ago. You should try linking to the rt (realtime, AFAIK) library i.e. by adding an "-lrt" in your command line or Makefile.
The best thing one can do when it's raining is to let it rain. - H. W. Longfellow

understanding is the path to enlightenment

Offline pomprockerTopic starter

  • Supreme Robot
  • *****
  • Posts: 1,430
  • Helpful? 16
  • Sorry miss, I was giving myself an oil-job.
Re: POSIX Threads
« Reply #2 on: January 25, 2010, 05:57:15 PM »
Well the symptoms are the main binary 'cvoicecontrol' seems to lock up when I run it. I do a 'ps aux | grep cvoice' and i see 1 zombie process and 3 'D' type uninterpretable sleep processes...My first thought it poor thread management.

I also downloaded gdb from a packaging system, but it seems to have been compiled without pthread support...

I'll have to inspect the Makefile when I get home.


Also I do have libpthreads.so on my system..not sure if that is what it needs or not.

(sorry i'm more of a sys admin type)

Offline rgcustodio

  • Robot Overlord
  • ****
  • Posts: 217
  • Helpful? 0
  • Use "Search" and ye might find answers!
Re: POSIX Threads
« Reply #3 on: January 25, 2010, 08:47:13 PM »
The library you mentioned is a shared library. Depends on the Makefile how the application uses the libraries. If its a static build it'll try to find the ".a" file. If its a dynamic build it use the ".so".

Since you're running on a PPC, it's likely an embedded system or an old mac with the G4/G5 processor. If your running embedded (WRS or MVL), did you compile your kernel properly i.e. with posix (semaphores, mqueues) support?

Since your a sysad you should know how to use strace. Give it a go. It might show some very important information.

Goodluck. Post your results.
The best thing one can do when it's raining is to let it rain. - H. W. Longfellow

understanding is the path to enlightenment

 


Get Your Ad Here

data_list