Subject: Re: CVS commit: pkgsrc/lang/libtcl-nothread
To: Jim Wise <>
From: Matthias Drochner <>
List: tech-pkg
Date: 07/02/2004 12:22:27
This is a multipart MIME message.

Content-Type: text/plain; charset=us-ascii said:
>  there do seem to be performance gains to using the libtcl-nothread in
> cases where the linked app does not need thread safety

Yep, I guess that GNU pth is significantly worse in this respect.
But, as said, it is not just the performance. I'll append a small
program which shows that it is not a good idea to dynamically
load libpthread into a program which was not built with -lpthread
from the beginning. Hope this helps to convince you...

best regards

Content-Type: text/plain ; name="ldpth.c"; charset=us-ascii
Content-Description: ldpth.c
Content-Disposition: attachment; filename="ldpth.c"

#include <stdio.h>
#include <unistd.h>
#include <signal.h>
#include <dlfcn.h>
#include <err.h>

int flag;

hdl(int sig)
	flag = 1;

	void *dlhdl;

	signal(SIGUSR1, hdl);
#if 1
	dlhdl = dlopen("/usr/lib/", RTLD_NOW);
	if (!dlhdl)
		errx(1, "%s", dlerror());

	kill(getpid(), SIGUSR1);
	printf("flag=%d\n", flag);
	return (0);