# Embedding ruby + pthread

**URL:** <https://www.ruby-forum.com/t/embedding-ruby-pthread/51986>\
**Category:** Ruby\
**Created:** [January 9, 2006, 10:43pm UTC](https://www.ruby-forum.com/t/embedding-ruby-pthread/51986 "2006-01-09T22:43:09Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![joe-dumoulin](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/9dc877/32.png) [@joe-dumoulin](https://www.ruby-forum.com/u/joe-dumoulin)\
**Post date:** [January 9, 2006, 10:43pm UTC](https://www.ruby-forum.com/t/embedding-ruby-pthread/51986/1 "2006-01-09T22:43:09Z")

</div>

I have a C executable that I’m embedding a Ruby GUI (using ruby-gnome2)  
in.

The GUI needs to run in it’s own thread.

Are there any pitfalls I should be aware of? I’m currently using  
pthread.

(I’m asking because my application segfaults on start half the time  
right when the Ruby GUI launches and I’m trying to track down causes.)

Do I need to build Ruby with pthread? Doing a ldd on the Ruby  
interpreter reported:

```
    libruby.so.1.8 => /usr/lib/libruby.so.1.8 (0x003c3000)
    libdl.so.2 => /lib/libdl.so.2 (0x00111000)
    libcrypt.so.1 => /lib/libcrypt.so.1 (0x00e35000)
    libm.so.6 => /lib/tls/libm.so.6 (0x0080c000)
    libc.so.6 => /lib/tls/libc.so.6 (0x00114000)
    /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x005ea000)

```

(and I don’t see pthread in there)

---

<div class="post-metadata">

**Author:** ![joe-dumoulin](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/9dc877/32.png) [@joe-dumoulin](https://www.ruby-forum.com/u/joe-dumoulin)\
**Post date:** [January 10, 2006, 1:07pm UTC](https://www.ruby-forum.com/t/embedding-ruby-pthread/51986/2 "2006-01-10T13:07:03Z")

</div>

> > > > > “J” == Joe Van D. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) writes:

J\> Do I need to build Ruby with pthread?

it’s best if you don’t want to have surprise …

see [ruby-core:4440]

Guy Decoux
