From mboxrd@z Thu Jan 1 00:00:00 1970 From: "J.A. Magallon" Subject: native vs posix threads mess Date: Sun, 14 Jul 2002 01:25:19 +0200 Sender: linux-smp-owner@vger.kernel.org Message-ID: <20020713232519.GA9563@werewolf.able.es> Mime-Version: 1.0 Content-Transfer-Encoding: 7BIT Return-path: Content-Disposition: inline List-Id: Content-Type: text/plain; charset="us-ascii" To: Lista Linux-SMP Hi all... This are just some comments, to see if somebody has any idea that can guide me to make things the more 'linux' way... Everybody says that POSIX threads in Linux suck. Well, I trusted them and begun to order my ideas with clone() and make some tests. Easy things are easy. Then you want mutexes. Try with semaphores. Use POSIX semaphores, look like more standard. After some digging (manual page says nothing) and a couple of failed links, I discover this: werewolf:~/aleph/ask/lib/include/ast> cat /usr/lib/librt.so /* GNU ld script librt.so.1 needs libpthread.so.0 to come before libc.so.6* in search scope. */ GROUP ( /lib/libpthread.so.0 /lib/librt.so.1 ) So I can't get rid of -lpthread (and its famous kernel call overriding). Semaphores are implemented on top of POSIX threads ? Grr.... And I can not share sem_t over clone(). So what is it useful for ???? Lets try with SystemV. At least they resolve directly in libc. People talk bad about pthreads, but looks like the only piece of order here. If you do threads with clone(), how would you get mutexes and semaphores and so on the 'linux' way ? TIA -- J.A. Magallon \ Software is like sex: It's better when it's free mailto:jamagallon@able.es \ -- Linus Torvalds, FSF T-shirt Linux werewolf 2.4.19-rc1-jam3, Mandrake Linux 8.3 (Cooker) for i586 gcc (GCC) 3.1.1 (Mandrake Linux 8.3 3.1.1-0.7mdk)