From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f678f,8e9b885446835ab4 X-Google-Attributes: gidf678f,public X-Google-ArrivalTime: 1994-11-08 17:44:00 PST Newsgroups: comp.unix.osf.misc Path: nntp.gmd.de!xlink.net!howland.reston.ans.net!news.moneng.mei.com!hookup!olivea!sgigate.sgi.com!odin!albion.engr.sgi.com!sp From: sp@albion.engr.sgi.com (Simon Patience) Subject: Re: errno and DCE and threads Message-ID: Sender: news@odin.corp.sgi.com (Net News) Nntp-Posting-Host: albion.engr.sgi.com Organization: Silicon Graphics, Inc. References: <39lsjk$lrf@clam.hi.com> <39o694$6a0@cantaloupe.srv.cs.cmu.edu> Date: Tue, 8 Nov 1994 21:35:12 GMT In article <39o694$6a0@cantaloupe.srv.cs.cmu.edu>, Andrew Hastings writes: |> In article <39lsjk$lrf@clam.hi.com> wright@clam.hi.com (David Wright) writes: |> >The single biggest problem is errno handling. Errno is a single, |> >global variable in standard Unix. (Granted, this was a really bad |> >design decision, but we're stuck with it.) Since DCE applications are |> >multi-threaded, they need to be able to keep errno on a per-thread |> >basis (so they don't trip over each other's values). |> |> Since you're productizing DCE, you can change the DCE thread |> implementation. Record errno along with the hardware registers in your |> thread context. When you switch threads, switch errno values. Why you would want to waste a valuable register on errno is beyond me, keeping the thread id in a register would be sensible as you access it frequently but errno? Errno is best kept in thread private data. By thread private I don't mean inaccessible to other threads, just not used by them. |> If you have kernel threads, your kernel should arrange to map errno |> separately for each thread. This is daft too. This means address space manipulations switching between threads. On some architectures this can be very expensive. So much for threads being light weight. Simon. -- Simon Patience Phone: (415) 390-4644 Silicon Graphics, Inc FAX: (415) 390-3542 2011 N. Shoreline Boulevard Email: sp@engr.sgi.com Mountain View, CA 94043