From owner-freebsd-hackers  Fri Apr  9  1:59:41 1999
Delivered-To: freebsd-hackers@freebsd.org
Received: from fleming.cs.strath.ac.uk (fleming.cs.strath.ac.uk [130.159.196.126])
	by hub.freebsd.org (Postfix) with ESMTP id D2BAB15000
	for <hackers@freebsd.org>; Fri,  9 Apr 1999 01:59:32 -0700 (PDT)
	(envelope-from roger@cs.strath.ac.uk)
Received: from cs.strath.ac.uk (scary.dmem.strath.ac.uk [130.159.202.5])
	by fleming.cs.strath.ac.uk (8.8.8/8.8.8) with ESMTP id JAA04069
	Fri, 9 Apr 1999 09:57:21 +0100 (BST)
Message-ID: <370DC114.E0A81FDE@cs.strath.ac.uk>
Date: Fri, 09 Apr 1999 09:57:56 +0100
From: Roger Hardiman <roger@cs.strath.ac.uk>
Organization: Strathclyde University
X-Mailer: Mozilla 4.04 [en] (X11; I; FreeBSD 3.1-STABLE i386)
MIME-Version: 1.0
To: dick@tar.com, hackers@freebsd.org
Subject: cc -pthread and -kthread switches
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Sender: owner-freebsd-hackers@FreeBSD.ORG
Precedence: bulk
X-Loop: FreeBSD.ORG

Hi,

What do you think to a new switch for cc?

cc has the extra compiler options -pthread and -kthread which invoke
the userland pthreads or the kernel threads respectivly.

How easy would it be to change this to
cc -pthread   *New meaning*. It invokes either -uthread or -kthread,
depending on a
              envoronment variable or a setting in a config file (eg
/etc/thread_type)

cc -uthread   use useland threads (what is currently -pthread)
cc -kthread   use kernel threads



I compile pthreaded code on several machines, some uni-processor,
some SMP using kthreads and Luoqi's SMP thread patches.
It means I could have one makefile, with just the -pthread option, and
compile my
code on all my machines with the same makefile.

Is this even possible?

(there is the problem of issuing the -DLINUXTHREAD option alongside
-kthread, but
perhaps this is already done)

Comment please?

Bye
Roger
--

Roger Hardiman
Strathclyde Uni Telepresence Research Group, Glasgow, Scotland.
http://telepresence.dmem.strath.ac.uk      0141 548 2897
roger@cs.strath.ac.uk


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message