| Subject: | Re: [Fwd: C Language Thread API] |
|---|---|
| From: | David Butenhof <david.butenhof@xxxxxx> |
| Date: | Tue, 12 Aug 2008 07:03:13 -0400 |
| Cc: | "austin-group-l@xxxxxxxxxxxxx" <austin-group-l@xxxxxxxxxxxxx> |
| Organization: | IS/MSL/iCAP |
| References: | <1218473241.3586.3.camel@amstaff2.msbit.com> <20080811181238.GD11392@xxxxxx> |
Ted Baker wrote: Here we go again, with more proliferation ofI have to agree with Ted. Perhaps the weakest part of this pseudo-generic wrapper package is that it lacks even an extension mechanism to change any semantic attributes of threads before starting them; something absolutely critical if any future foray into realtime scheduling support might come to be in the cards. Or, for that matter, any realistic use of the "portable" C facility on real systems for real programs, where extensions to access base thread implementation capabilities are going to be needed (e.g., realtime, stack allocation control, etc.) Some APIs like UI threads allow creating suspended threads, setting attributes via additional APIs, and then starting it; others, like pthreads, tried a more structured approach with attributes objects on the create operation (which also has the advantage of being easily layered on a base implementation that works the other way, while the converse is possible but much messier). This has neither. Of course the "xtime" thing and thrd_sleep() is just POSIX timespec and nanosleep(). Adding a C language facility equivalent to 'struct timespec' will, inevitably, end up with a similar but semantically unrelated data type that needs to be converted and interpreted in any real application, causing pain for innumerable developers for many years to come. While I see the motivation that drives messes like this, I don't like it. C can't grow to encompass all of the differences between various operating systems to enable 100% portable programs, no matter what. Frankly I'd much prefer that C focus on a good, strong, portable memory model that would enable fully portable use and creative/useful "abuse" (lock-free, wait-free) of the various threading APIs already widely deployed and understood. Especially when the "standard" C thread interface is so bare-bones and non-extensible that it essentially prevents most developers from using it anyway. The memory model is critical. Having a C runtime threading API isn't, unless it's going to allow full portable use of at least most common posix and win32 mechanisms and attributes; so that you can actually write a useful portable (or at least "mostly portable") threaded program. This API, as it stands now, doesn't come close to fitting that bill. On Mon, Aug 11, 2008 at 09:47:21AM -0700, Nick Stoughton wrote: |
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| ||
| Previous by Date: | Re: [Fwd: C Language Thread API], yodaiken@xxxxxx |
|---|---|
| Next by Date: | Re: [Fwd: C Language Thread API], Hallvard B Furuseth |
| Previous by Thread: | Re: [Fwd: C Language Thread API], Ted Baker |
| Next by Thread: | Re: [Fwd: C Language Thread API], Hallvard B Furuseth |
| Indexes: | [Date] [Thread] [All Lists] |