Article View: borland.public.cppbuilder.nativeapi
Article #12145Re: TThread or pthreads
From: Alisdair Meredith (TeamB)
Date: Tue, 23 Dec 2003 10:44
Date: Tue, 23 Dec 2003 10:44
34 lines
2800 bytes
2800 bytes
<b> wrote: > Which one to use "TThread" or "pthreads" and why ? > http://www.humanfactor.com/pthreads/ > http://sources.redhat.com/pthreads-win32/ > > Is there any BCB and KylixC++ compatible "pthreads" library and > examples around ? TThread is easiest to get up an running with in BCB/Kylix, but it is an Delphi class wrapped in C++. As such, any code using it will never be portable to a non-Borland compiler. It is a nice OO wrapper around a thread context. pthreads is an old-school 'C' interface so a lot more work to get up and running. I would look for a wrapper library before using this in C++ (or write my own) Popular wrappers are available with ACE and Boost (see other reply) pthreads is a posix API, and so portable to any compiler supporting Posix, or anything else with an appropriate mapping (eg Cygwin) Threads in C++ desperately need some kind of standardisation, 'C' pthreads are the closest thing we have at the moment Also be aware that going with TThread may give you an awkward rewrite in the future if you move to the new Borland product, CBuilderX, which currently has no VCL support. We hope that might be addressed in a future release, but stil no official word from Borland. [In our own code, we use TThread because the ease of getting started has been more important than portablility to us, at least so far] AlisdairM (TeamB)
Technical Details
Message-ID:
<3fe82a82$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!newsfeed2.dallas1.level3.net!news.level3.com!crtntx1-snh1.gtei.net!news.gtei.net!newsfeed1.easynews.com!easynews.com!easynews!feed1.news.rcn.net!rcn!in.100proofnews.com!in.100proofnews.com!opentransit.net!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<3fe42f8b@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 106fd3,4c68da4ff5797ffa X-Google-Attributes: gid106fd3,public X-Google-Thread: fb250,4c68da4ff5797ffa X-Google-Attributes: gidfb250,public X-Google-Thread: 10cc67,4c68da4ff5797ffa X-Google-Attributes: gid10cc67,public X-Google-Thread: 102541,4c68da4ff5797ffa X-Google-Attributes: gid102541,public X-Google-ArrivalTime: 2003-12-23 03:52:20 PST From: "Alisdair Meredith (TeamB)" <alisdair.NO.SPAM.PLEASE.meredith@uk.renaultf1.com> Subject: Re: TThread or pthreads Newsgroups: borland.public.cppbuilder.nativeapi,borland.public.cppbuilder.students,borland.public.kylix.linuxapi,borland.public.kylix.students References: <3fe42f8b@newsgroups.borland.com> Organization: Renault F1 Team Ltd. User-Agent: XanaNews/1.15.8.4 NNTP-Posting-Host: 195.153.139.2 Message-ID: <3fe82a82$1@newsgroups.borland.com> Date: 23 Dec 2003 03:44:02 -0700 X-Trace: newsgroups.borland.com 1072179842 195.153.139.2 (23 Dec 2003 03:44:02 -0700) Lines: 34 Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!newsfeed2.dallas1.level3.net!news.level3.com!crtntx1-snh1.gtei.net!news.gtei.net!newsfeed1.easynews.com!easynews.com!easynews!feed1.news.rcn.net!rcn!in.100proofnews.com!in.100proofnews.com!opentransit.net!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail