On 03/11 06:02, Antoine Jacoutot wrote: > On Fri, 11 Mar 2011, Jeremy Evans wrote: > > > Is it better to show the wrong example and have something that works, or > > That's were I don't agree. Because if it works, it's by luck. Luck implies some component of chance. Maybe "works, with issues"?
> > to not show an example at all and have something that doesn't work? > > What problems does it actually cause? > > The same problem that you outline below, there is a reason why we don't > ship threaded perl and ruby. > That is also the reason I marked devel/p5-Glib2 as BROKEN. I tried using > -lpthread as well back in the time. For some stuffs it worked, for > others it didn't. It's just too much of a mess and until we get > rthreads, then I think we should not encourage using software that work > most of the time by luck. Glib2 needs threads (for gthread), our perl is > not threaded, and if you force -lpthread that means you will start > messing with fds, it may work or not... Well, if what you're doing messes with fds in a way that breaks when linked with -lpthread, then it won't work. However, if your code doesn't do things with fds, it will work fine. For example, I have a graphical file renaming program that uses qtruby. I've never experienced an issue with it using either the LD_PRELOAD hack or linking with -lpthread. For me, the software works fine and meets my needs. Basically, linking with -lpthread causes the exact same issues that using the LD_PRELOAD hack will cause. All it does is save the user from having to modify the calling program's environment. So the question really becomes, should we have such software at all in the ports tree? As I see it, linking with -lpthread is superior to using the LD_PRELOAD hack in every way. So we should either link with -lpthread or mark the port BROKEN as you did with devel/p5-Glib2. In the case of importing new software that has this issue, it should either be imported using -lpthread, or it should not be imported at all. > Again as I said, it's just me, maybe others disagree. Also several of us > spent quite some time moving hundreds of ports from using -lpthread into > using -pthread (not all were done though). And for most programs, -pthread is correct. The only known cases where -lpthread is necessary are for native extensions for interpreters that don't link with -pthread (e.g. perl, ruby, tcl). Jeremy