Re: pthread_setconcurrency

Hi John,

> I'm moving something from pthreads to g_thread and I noticed there's
> no wrapping for pthread_setconcurrency(). Does anyone know the
> reasoning here? Should I ignore this?

GLib tries to handle threads from an abstract perspective to make them
more portable. pthread_setconcurrency generally only makes sense for
platforms with m-to-n thread (pthread_setconcurrency sets 'n'). And this
is a implementation detail. If a program really needs it (which of
course can happen, but it should be rare), it has to to directly use the
underlying thread platform. Note however, that most thread
implementations nowadays are 1-to-1, most notably Linux. There
pthread_setconcurrency does not make any sense at all.

In short: Ignore it and hope, it'll work, otherwise try to find out, why
it is used there (It might be used to make a 1-to-1 model on top of a
m-to-n model, though bound threads would have had the same effect in a
more clean way) and ask again.
Sebastian Wilhelmi                 |            här ovanför alla molnen
mailto:seppi seppi de              |     är himmlen så förunderligt blå                    |

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]