Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
GLIB and Threads
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Unsupported Software
View previous topic :: View next topic  
Author Message
mick1001
n00b
n00b


Joined: 17 Jan 2008
Posts: 8

PostPosted: Thu Dec 18, 2008 6:46 am    Post subject: GLIB and Threads Reply with quote

emerge glib shows
--with-threads=posix

but
main(gint argc, gchar *argv[])
{
if(!g_thread_pool_push ())
printf("Threads unsupported\n");
}

Shows that threads aren't supported. Using pthreads directly works.

What gives?
Back to top
View user's profile Send private message
Naib
Watchman
Watchman


Joined: 21 May 2004
Posts: 5673
Location: Removed by Neddy

PostPosted: Thu Dec 18, 2008 1:24 pm    Post subject: Reply with quote

That doesn't show that threads arn't suported, it shows you are unable to push a new job (mainly because you aint made a thread pool)

http://library.gnome.org/devel/glib/unstable/glib-Thread-Pools.html
Quote:

To create a new thread pool, you use g_thread_pool_new(). It is destroyed by g_thread_pool_free().

If you want to execute a certain task within a thread pool, you call g_thread_pool_push().


so create a threadpool 1st, then push to it
_________________
The best argument against democracy is a five-minute conversation with the average voter
Great Britain is a republic, with a hereditary president, while the United States is a monarchy with an elective king
Back to top
View user's profile Send private message
mick1001
n00b
n00b


Joined: 17 Jan 2008
Posts: 8

PostPosted: Thu Dec 18, 2008 2:12 pm    Post subject: Reply with quote

Sorry, wrong snippet. I discovered it when trying to use thread pools.

if(!g_thread_supported()) {
printf("Threads not supported\n");
}


returns Threads no supported


But I
emerge glib
and it still didn't work, so

emerge libc
then
emerge glib

and everything works. I don't understand why as I didn't change any USE settings and I do regular
emerge --update world --deep

Anyway, seems to be good now.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Unsupported Software All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum