Linux-Development-Sys Digest #634, Volume #6 Sun, 18 Apr 99 10:14:23 EDT
Contents:
Re: Scheduling for user-level threads (Byron A Jeff)
Re: CodeWarror for Linux (was: Re: Programming tools for ...) (Peter Samuelson)
Re: company (Peter Samuelson)
Re: Can you make a driver that runs as an application? (Peter Samuelson)
Re: problem with executable file (Peter Samuelson)
Re: PROC-fs, Need to make it CHARGEBEL (Peter P. Eiserloh)
Re: Driver for Intel740 video card (Andy Isaacson)
Re: Driver for Intel740 video card (Kelvin)
Re: Linux system ID, is there such a thing? (Peter Samuelson)
Re: Can you make a driver that runs as an application? ([EMAIL PROTECTED])
Re: [Q] Linux pstat() or table() equivalent (Jens-Uwe Mager)
Re: ncurses question (Peter Samuelson)
Re: asynchronous disk I/O (Peter T. Breuer)
Re: asynchronous disk I/O (Peter Samuelson)
----------------------------------------------------------------------------
From: [EMAIL PROTECTED] (Byron A Jeff)
Subject: Re: Scheduling for user-level threads
Date: 17 Apr 1999 22:41:13 -0400
In article <[EMAIL PROTECTED]>,
<[EMAIL PROTECTED]> wrote:
>
>I have a basic question ?
No. It isn't a basic question.
>
>Consider a user-level implementation of threads. How can I write a
>scheduler for user-level threads within a process. For example
>when a thread blocks on I/O or system-call , I want another user-level
>thread to be scheduled. If I don't have a scheduler then the entire
>process will be blocked , which I don't want. Without a scheduler
>a thread cannot be scheduled without being voluntarily relinquised
>by current thread.
A scheduler won't help you here. The problem is that user threads are not
first class entities to the operating system. They do not exist to the
kernel. The kernel simply sees one process that when it blocks, all execution
ceases.
This is a problem that I'm been examining for my PhD thesis work. The short
answer is that in the kernel's current form there's no way to implement what
you request without modification.
What most user threads packages do is not block. Cooperative scheduling is
done by have each user thread check for a block on a blockable operation, and
if a block would occur, the thread yields the processor. So other threads
get to run because the process never actually blocks.
I wrote a 3 page white paper on how to instrument the kernel to solve the
problem. The essense of the idea is to use Linux kernel threads (kthread) as
user thread engines, and add a mechanism in the kernel that binds two kernel
threads together. A system call would do the binding and put the caller to
sleep. That kthread would sleep until the kthread that was bound to it blocked.
The kernel would then activate the sleeping kthread.
In this case user threads would be run until one blocked the kthread it is
running on, The other kthread awakes. Since kthreads share process memory,
the awakened kthread can view the uthread state, create another kthread,
bind to it, and go back to sleep.
So a uthread program would always have a kthread to run uthreads even as
individual uthreads blocked their kthreads.
Only thing I didn't clear up in the model was what to do when the kthread
that blocked woke up. Both concurrent execution, returning the uthread to
the ready queue, or continuing to block until signalled fron the manager
kthread are all possibilities.
Just some thoughts.
BAJ
>
>How is this taken care of in Posix threads ? ( In linux I beleive
>it uses clone() & some scheduling primitives ) Do they necssarily
>require OS support for scheduling.
>
>It would appreciate if anyone could throw light on these issues.
>
>Vijayan
>([EMAIL PROTECTED])
>
------------------------------
From: [EMAIL PROTECTED] (Peter Samuelson)
Subject: Re: CodeWarror for Linux (was: Re: Programming tools for ...)
Date: 18 Apr 1999 01:36:57 -0500
Reply-To: Peter Samuelson <[EMAIL PROTECTED]>
[Sam Holden]
> > I guess we lose those programmers who can't work out how to use
> > make. Oh well no big loss.
[Gregory Nicholls <[EMAIL PROTECTED]>]
> <chuckle> That's what IBM orignally said about OS/2.
I don't remember that one. My recollection: "I guess we lose those
people who can't afford 4MB of RAM. Oh well no big loss."
> > Maybe that's because once someone bothers to learn how to use a
> > few simple tools properly they can do everything an IDE does.
[...]
> > Nothing worse than a programmer who can't be bothered spending
> > some time learning a few tools.
> Sure there is. People who use C and other wimpy languages. I mean if
> you can't be bothered to learn to program in hex . . .
Not sure what you're getting at. Are you saying a person *can* be as
productive in hex as in ASCII? Or are you saying a person *cannot* be
as productive using a few tools like `make' as with an IDE? Or were
you mistaking an encoding for a language? (:
> > My experience tells me that Unix is more powerful than an IDE.
> <sigh> Unix is an OS . . . .
Yes but in most incarnations it comes standard with a pretty powerful
programmer's toolset. Sam no doubt meant the toolset. (Not that I'm
going to defend him against nitpicking, after pointing out "hex"
vs. "machine code" above....)
> Are you sure you're a programmer ??? you sound like a coder.
I'm not sure I understand the euphemistic nuances of the two words. Is
one supposed to imply more flexibility? Depth of knowledge? Ease of
integration with project managers and other suits?
--
Peter Samuelson
<sampo.creighton.edu!psamuels>
------------------------------
From: [EMAIL PROTECTED] (Peter Samuelson)
Subject: Re: company
Date: 18 Apr 1999 01:42:25 -0500
Reply-To: Peter Samuelson <[EMAIL PROTECTED]>
[mee <[EMAIL PROTECTED]>]
> What company makes linux? I'm trying to invest and I can't find the stock.
Microsoft. Apple makes the biggest competitor, MK-Linux. Hence the
historic rivalry between the two.
--
Peter Samuelson
<sampo.creighton.edu!psamuels>
------------------------------
From: [EMAIL PROTECTED] (Peter Samuelson)
Subject: Re: Can you make a driver that runs as an application?
Date: 18 Apr 1999 01:50:48 -0500
Reply-To: Peter Samuelson <[EMAIL PROTECTED]>
[Martin Maney <[EMAIL PROTECTED]>]
> > What you have described here is a shared library, not a driver. No?
[<[EMAIL PROTECTED]>]
> I don't *think* so. Shared libraries run in a shared memory space
> but variables stored in the global memory space are seperate for each
> process.
That's where shared memory comes in. Look up either shmctl() or
mmap().
> This is why threads being added to Linux forced a change from libc to
> glibc. The libc library was not reentrant, but the glibc library
> was. Um, I think anyhow.
Actually nothing "forced" the change. glibc has a number of advantages
over libc5 (and some disadvantages), reentrancy being one of them, and
of course it didn't hurt that H.J. Lu stopped actively maintaining
libc5 and started helping with glibc....
> I could do it with shared memory I suppose but the documentation on
> that is a bit sketchy and I don't know just how portable it is.
You're writing "device drivers" and you care about portability? (:
Anyway, SysV shared memory (shmctl()) and mmap() are relatively
standard, so portability shouldn't be that much of a problem.
> Is a shared lib what I want? If so that's cool, but as it is, it
> appears that GGI can handle what I want after all although I would
> sort of like to uncomplicate my life since GGI only appears to be in
> CVS.
Actually I would vote for GGI too -- but in any case I'd still
recommend doing your own shared library (which would call or replace
the libggi API) rather than patching libggi itself. Dunno, maybe
patching libggi would be cleaner -- use whatever works.
--
Peter Samuelson
<sampo.creighton.edu!psamuels>
------------------------------
From: [EMAIL PROTECTED] (Peter Samuelson)
Subject: Re: problem with executable file
Date: 18 Apr 1999 01:52:18 -0500
Reply-To: Peter Samuelson <[EMAIL PROTECTED]>
[Stefan Monnier <[EMAIL PROTECTED]>]
> use
> % gcc -o myprog myprog.c
> % ./myprog
> Segmentation fault.
> %
You recommend doing this from csh? (:
--
Peter Samuelson
<sampo.creighton.edu!psamuels>
------------------------------
From: [EMAIL PROTECTED] (Peter P. Eiserloh)
Subject: Re: PROC-fs, Need to make it CHARGEBEL
Date: 18 Apr 1999 09:24:14 GMT
In article <[EMAIL PROTECTED]>, Andi Kleen wrote:
>[EMAIL PROTECTED] writes:
>
>> Hello,
>>
>> I need statistics from the kernel about how many jiffies a process has
>> used when it's done.
>
>Just use "time process" in your shell.
Don't use jiffies in user space. You might think that there
are 100 jiffies per second (HZ=100), but that is only the
default with most archtectures. The alpha uses a HZ=1024.
Even the intel machine can have the HZ changed, some people
are talking about using 400 on intel.,
>
>2.2 also has BSD style process accounting when you compile it in,
>then the kernel is able to automatically write an accounting
>record for every finished process to a file. See include/linux/acct.h
>for the information it contains.
>
>-Andi
>--
>This is like TV. I don't like TV.
Like Andi said, use the acct package. There are already solutions
to most things people want to do. You don't have to reinvent the
wheel, especially since years of work has gone into the existing
solutions.
--
+...................................................................
| Peter P. Eiserloh [EMAIL PROTECTED]
| http://www.ridgenet.net/~eiserloh
| Unix, Linux, Modula-2/3, Compilers, Esperanto, Physics,
| Science Fiction, Babylon-5
+...................................................................
------------------------------
From: [EMAIL PROTECTED] (Andy Isaacson)
Subject: Re: Driver for Intel740 video card
Date: 18 Apr 1999 02:11:57 GMT
In article <7f9r38$83s$[EMAIL PROTECTED]>, George Tachev wrote:
> I can't find place with drivers for video cards, if anyone can help me,
> write, please!
The X server supporting the i740 chipset is available from
http://www.precisioninsight.com/products.html
-andy
------------------------------
From: Kelvin <[EMAIL PROTECTED]>
Subject: Re: Driver for Intel740 video card
Date: 18 Apr 1999 09:32:16 GMT
George Tachev wrote:
>
> I can't find place with drivers for video cards, if anyone can help me,
> write, please!
>
>
http://www.redhat.com/corp/press/current_driver.html
================== Posted via SearchLinux ==================
http://www.searchlinux.com
------------------------------
From: [EMAIL PROTECTED] (Peter Samuelson)
Crossposted-To: comp.os.linux.development.apps
Subject: Re: Linux system ID, is there such a thing?
Date: 18 Apr 1999 00:43:50 -0500
Reply-To: Peter Samuelson <[EMAIL PROTECTED]>
[Clint Byrum <[EMAIL PROTECTED]>]
> I went through the same problem. On HP-UX one can get the system
> serial # with the uname command.
AIX too: `uname -m'. I think Sun motherboards have a hardwired MAC
address which they feed to the Ethernet controller on boot.
> Linux (due to the use of Intel Hardware), has no such ID.
Not so! Intel's Pentium III has serial numbers, or hadn't you heard? (:
Seriously, though, I guess if you can't rely on having a network card,
you can't really rely on having a PIII either....
In an environment where the computers weren't networked anyway, why
would it be important to identify them (more or less) uniquely?
--
Peter Samuelson
<sampo.creighton.edu!psamuels>
------------------------------
From: [EMAIL PROTECTED]
Subject: Re: Can you make a driver that runs as an application?
Date: Sun, 18 Apr 1999 05:49:44 GMT
In article <7fbamb$k30$[EMAIL PROTECTED]>,
Martin Maney <[EMAIL PROTECTED]> wrote:
> [EMAIL PROTECTED] wrote:
> > I wanted to do a proof of concept experiment with Linux. I would like
> > to write a driver that is SEPERATE from the kernel so that when I screw up
>
> If it's SEPARATE from the kernel then it isn't a driver; what you describe
> wouldn't really be a driver even if it were loaded as a kernel module, I
> think. Let's see now...
Pseudo driver then. :)
> > do is make an API available to several programs that is loaded into one
> > location in memory and is completely reentrant - basically a driver. Is
there
> > any way I can divorce the "driver" from the kernel so that I can do this?
>
> What you have described here is a shared library, not a driver. No?
I don't *think* so. Shared libraries run in a shared memory space but
variables stored in the global memory space are seperate for each process.
So if you had code like the following:
static int i=4;
void fun(void)
{
printf ("I is now %d\n",i++);
}
which 2 different programs called, 'i' would be printed as '4' both times if
it appeared in a shared library. In a driver you would see 4 then 5
(assuming you didn't have a context switch at an inopprotune time).
Also nasty things like race conditions and other fun stuff disappear if
this is a shared library. Correct me if I'm wrong on this one.
This is why threads being added to Linux forced a change from libc
to glibc. The libc library was not reentrant, but the glibc library was.
Um, I think anyhow.
I would like the global memory to be shared across multiple processes.
I wanted to do this to facilitate interprocess communication without resorting
to a TCP/IP pipe. I could do it with shared memory I suppose but the
documentation on that is a bit sketchy and I don't know just how portable
it is.
> > You may need to know what I plan to do: Basically I want to make
> > a GUI api that runs on top of X with XSHM. This will be a low level
graphics
> > library that will support fonts, sprites, etc., but only at the low level.
> > I would then like to make it possible for applications to access the GUI
> > API but without having to send data via a TCP/IP pipe or something slow
> > and ugly like that and without a context switch. I understand that X11 will
>
> Yep, that's a shared library. Relax. There are some perhaps unintuitive
> things that have to be done to build this, but the one that's more than
> getting some options and rules right in your makefile is one that you ought
> to be pretty comfortable with already from your embedded work: making the
> code reentrant. This ought to be a piece of cake, aside from details like
> -fpic (or -fPIC).
>
> Luck!
Is a shared lib what I want? If so that's cool, but as it is, it appears
that GGI can handle what I want after all although I would sort of like to
uncomplicate my life since GGI only appears to be in CVS. Anyhow, it's been
quite some time since I last looked at GGI. Now, to me at least, it looks
viable so it may not be painful. Perhaps my bias has only changed.
Thanks
-Rich
============= Posted via Deja News, The Discussion Network ============
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
From: [EMAIL PROTECTED] (Jens-Uwe Mager)
Subject: Re: [Q] Linux pstat() or table() equivalent
Date: Sun, 18 Apr 1999 09:56:06 GMT
On Sun, 18 Apr 1999 00:02:43 -0500, Paul Roebuck <[EMAIL PROTECTED]> wrote:
>I was trying a quick port of a library I have that runs on both HP-UX and
>Digital Alpha.
>It works fine except I don't know the equivalent routine under Linux. I
>have another
>vanilla version that parses "ps" output obtained via popen() but that
>seems clumsy
>and inelegant. Can someone provide an elegant Linux solution, if one
>exists? Thanks.
[ cut code ]
check out /proc/self/cmdline, this appears to be what you want.
--
Jens-Uwe Mager <pgp-mailto:62CFDB25>
------------------------------
From: [EMAIL PROTECTED] (Peter Samuelson)
Subject: Re: ncurses question
Date: 18 Apr 1999 01:23:16 -0500
Reply-To: Peter Samuelson <[EMAIL PROTECTED]>
[Dan Miller <[EMAIL PROTECTED]>]
> Is there some way to make control characters appear as the standard
> 1-byte characters, rather than as ^-chars?? For example, addch(2)
> displays ^B rather than the filled-in happy face... I'd like to
> modify this functionality if I possibly can...
Not a Linux development question. Take it to comp.unix.programmer.
(Followups set.)
--
Peter Samuelson
<sampo.creighton.edu!psamuels>
------------------------------
From: [EMAIL PROTECTED] (Peter T. Breuer)
Subject: Re: asynchronous disk I/O
Date: 18 Apr 1999 13:17:17 GMT
Reply-To: [EMAIL PROTECTED]
Peter Samuelson ([EMAIL PROTECTED]) wrote:
: [Rik van Riel <[EMAIL PROTECTED]>]
: > > Linux 2.2 has this function. If you've been looking at version 2.0
: > > it's no wonder -- you're looking at 3 year old code...
: [Stefan Monnier <[EMAIL PROTECTED]>]
: > 2.0 was still "the latest" only a couple months back...
: But it's still three-year-old code. Very little functionality has been
: added between 2.0.0 and 2.0.37. (Not counting things like new and/or
LOTS of drivers.
: updated drivers. Basically almost *no* core functionality changed.)
: And the little functionality that *was* added, particularly around the
: .29-33 era, made a lot of people mad because it was too destabilizing.
Indeed. I stayed at 2.0.25 for three years, patching in new drivers and
fixes carefully, to maintain my linux machines. I was unhappy with
every single kernel release from 2.0.29 up (and never moved to 2.0.28
because it wasn't worth it and "not unhappy" didn't make a good risk).
But I am very happy indeed with 2.0.36. I have moved the base over almost
entirely to 2.0.36. It still has known bugs (e.g. network leak with
bridging and scsi) that can be show stoppers, but the bugs in 2.2.* are
much much worse from a stability point of view. I don't plan to think
about trying to move forwards for about a year.
: --
: Peter Samuelson
: <sampo.creighton.edu!psamuels>
--
Peter
------------------------------
From: [EMAIL PROTECTED] (Peter Samuelson)
Subject: Re: asynchronous disk I/O
Date: 18 Apr 1999 00:56:53 -0500
Reply-To: Peter Samuelson <[EMAIL PROTECTED]>
[Rik van Riel <[EMAIL PROTECTED]>]
> > Linux 2.2 has this function. If you've been looking at version 2.0
> > it's no wonder -- you're looking at 3 year old code...
[Stefan Monnier <[EMAIL PROTECTED]>]
> 2.0 was still "the latest" only a couple months back...
But it's still three-year-old code. Very little functionality has been
added between 2.0.0 and 2.0.37. (Not counting things like new and/or
updated drivers. Basically almost *no* core functionality changed.)
And the little functionality that *was* added, particularly around the
.29-33 era, made a lot of people mad because it was too destabilizing.
--
Peter Samuelson
<sampo.creighton.edu!psamuels>
------------------------------
** FOR YOUR REFERENCE **
The service address, to which questions about the list itself and requests
to be added to or deleted from it should be directed, is:
Internet: [EMAIL PROTECTED]
You can send mail to the entire list (and comp.os.linux.development.system) via:
Internet: [EMAIL PROTECTED]
Linux may be obtained via one of these FTP sites:
ftp.funet.fi pub/Linux
tsx-11.mit.edu pub/linux
sunsite.unc.edu pub/Linux
End of Linux-Development-System Digest
******************************