Linux-Development-Apps Digest #409, Volume #7    Thu, 17 May 01 06:13:09 EDT

Contents:
  [Q]What is frame buffer??... Help ("songjg")
  Re: how many CPU's? (Mun Chang-min)
  Re: SIGSEGV is not blocking (Robert Redelmeier)
  Re: SIGSEGV is not blocking
  Create Makefile ("Nera")
  Re: SIGSEGV is not blocking (Eric P. McCoy)
  Re: Newbie programmer ("Paul Jones")
  asynchronous io ("D. Stimits")
  Re: A linuxthreads C++ object question (Kaz Kylheku)
  Re: Why does this leak memory??? (Kaz Kylheku)
  Do I need to develop a record and replay facility under X? ([EMAIL PROTECTED])
  Re: [Q]What is frame buffer??... Help ("Zoran Cutura")
  Re: A linuxthreads C++ object question (Chris)
  Re: how many CPU's? (Chris)
  Re: How do I make a messagebox?? (Josef Moellers)
  Re: arrow keys (Josef Moellers)
  xml api ("Karim A.")
  Re: xml api (Vyacheslav Burdjanadze)
  Re: Create Makefile (Lars Luthman)
  Re: Newbie programmer (Kasper Dupont)
  Re: transpareny (Kasper Dupont)

----------------------------------------------------------------------------

From: "songjg" <[EMAIL PROTECTED]>
Subject: [Q]What is frame buffer??... Help
Date: Thu, 17 May 2001 11:10:36 +0900

I want to show Bitmap and Dialog Box on screen Without X.

Somebody recommend me to use frame buffer.
As I am a beginner with linux, I don't know what frame buffer is, and How to
use it.

Anyone who knows the answer help me... please..


Thanks.





------------------------------

From: Mun Chang-min <[EMAIL PROTECTED]>
Subject: Re: how many CPU's?
Date: Thu, 17 May 2001 11:15:40 +0900

Charles Herman wrote:

> Is there a function I can call that will tell me how many CPU's the
> computer has?
> 
> -charles
> 
> 
> 

There is cpu information in "/proc/cpuinfo", "/proc/stat"


------------------------------

Date: Wed, 16 May 2001 21:14:02 -0500
From: Robert Redelmeier <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.development.system,comp.programming.threads
Subject: Re: SIGSEGV is not blocking

David Schwartz wrote:
> 
> Linus Torvalds wrote:
> 
> > Now, you might say that killing is better. I might agree. We can vote on
> > it, I don't personally particularly care one way or the other. But you
> > only get those two choices: kill the dang thing outright, or just ignore
> > the blocking. We just don't have any other good choices.
> 
>         Well, you could spin forever, faulting on the instruction and then
> retrying it because the signal was blocked. One could argue that this is
> the most theoretically perfect thing to do, but it's hardly useful
> behavior under any circumstances I can imagine.

It could be worse than that.  The continuously generated interrupt
could prevent the scheduler from ever running, and the machine would 
be effectively locked-up.

-- Robert

------------------------------

From: [EMAIL PROTECTED] ()
Crossposted-To: comp.os.linux.development.system,comp.programming.threads
Subject: Re: SIGSEGV is not blocking
Date: Thu, 17 May 2001 02:30:16 -0000

In article <[EMAIL PROTECTED]>, Robert Redelmeier  <[EMAIL PROTECTED]> wrote:

>It could be worse than that.  The continuously generated interrupt
>could prevent the scheduler from ever running, and the machine would 
>be effectively locked-up.

But it's a trap not an interrupt.  The timer interrupt should still
get serviced.

--
http://www.spinics.net/linux

------------------------------

From: "Nera" <[EMAIL PROTECTED]>
Subject: Create Makefile
Date: Thu, 17 May 2001 12:00:53 +0800

This is a multi-part message in MIME format.

=======_NextPart_000_0027_01C0DEC9.062ED860
Content-Type: text/plain;
        charset="big5"
Content-Transfer-Encoding: quoted-printable

Hi,
        I am going to develope my streaming server on Linux Platform
But the problem I need is to ensure the protability of the source code,
How do I generate Makefile to meet my need?

Thx
Nera

=======_NextPart_000_0027_01C0DEC9.062ED860
Content-Type: text/html;
        charset="big5"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; charset=3Dbig5">
<META content=3D"MSHTML 5.50.4522.1800" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT size=3D2>Hi,</FONT></DIV>
<DIV><FONT size=3D2>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; I am going to =
develope=20
my streaming server on Linux Platform</FONT></DIV>
<DIV><FONT size=3D2>But the problem I need is to ensure the protability =
of the=20
source code,</FONT></DIV>
<DIV><FONT size=3D2>How do I generate Makefile to meet my =
need?</FONT></DIV>
<DIV><FONT size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT size=3D2>Thx</FONT></DIV>
<DIV><FONT size=3D2>Nera</FONT></DIV></BODY></HTML>

=======_NextPart_000_0027_01C0DEC9.062ED860==


------------------------------

Crossposted-To: comp.os.linux.development.system,comp.programming.threads
Subject: Re: SIGSEGV is not blocking
From: [EMAIL PROTECTED] (Eric P. McCoy)
Date: 17 May 2001 00:32:49 -0400

[EMAIL PROTECTED] () writes:

> >It could be worse than that.  The continuously generated interrupt
> >could prevent the scheduler from ever running, and the machine would 
> >be effectively locked-up.

> But it's a trap not an interrupt.  The timer interrupt should still
> get serviced.

I don't think so.  The fault handler would return, the CPU would
re-execute the faulting instruction (under the assumption that it
would be corrected), and would fault again.

I guess some timer ints could get in during the handler or whatever,
depending on how Linux does things (I have no idea), but the system
would likely be effectively frozen, even if not technically.  I think,
but am not sure, that exceptions in userland go through gates to move
up the privilege ring, and I don't know how IA32 CPUs handle
interrupts during state changes like those.

-- 
Eric McCoy <[EMAIL PROTECTED]>
  "Knowing that a lot of people across the world with Geocities sites
absolutely despise me is about the only thing that can add a positive
spin to this situation."  - Something Awful, 1/11/2001

------------------------------

From: "Paul Jones" <[EMAIL PROTECTED]>
Crossposted-To: alt.os.linux.mandrake,comp.os.linux.development.system
Subject: Re: Newbie programmer
Date: Thu, 17 May 2001 15:18:33 +1000

Sorry for being vague!! I was after c++ and preferably an ide to go with it.
Thanks for all the help so far!!!

__
P.j

"Paul Jones" <[EMAIL PROTECTED]> wrote in message
news:9dtpfd$550$[EMAIL PROTECTED]...
> I was wondering if anyone could point me in the direction of some help for
> people moving from windows to Linux development. I can't seem to find
> anything on the subject. I'm ok at windows programming, but I'm assuming
> that linux has totally different libraries and stuff. Also I'm still
> learning Linux which makes it a bit hard :)
>
> All help appreciated!
>
> Paul Jones.
>
>



------------------------------

Date: Wed, 16 May 2001 23:59:13 -0600
From: "D. Stimits" <[EMAIL PROTECTED]>
Reply-To: [EMAIL PROTECTED]
Subject: asynchronous io

I'm trying to find out if the aio_read is available, and if so,
approximately what kernel version it is available from?

D. Stimits, [EMAIL PROTECTED]

------------------------------

From: [EMAIL PROTECTED] (Kaz Kylheku)
Subject: Re: A linuxthreads C++ object question
Reply-To: [EMAIL PROTECTED]
Date: Thu, 17 May 2001 06:43:15 GMT

On Wed, 16 May 2001 19:08:23 +0100, Daniel Barron
<[EMAIL PROTECTED]> wrote:
>With C++ when I create an object in a linuxthreaded app, how careful do I
>need to be with race conditions and the like?

You need to be as violent with race conditions as possible. Shoot them first,
then ask questions later. ;)

>What I mean is, in C (not++)
>an app is just one big lump of code, but in C++ you have descrete objects
>that contain data, variables and code.

Firstly ``data'' and ``variables'' are reallyt the same thing, except
that some kinds of C++ objects contain data which are not directly visible
to the programmer, such as vtable pointers, type informations and so on.
Such fields are set up as an object is constructed. The best rule to follow
is to avoid accessing an object from multiple threads until it is fully
constructed, and after just before its destruction has begun. This
rule is required because there is no satisfactory way to protect this
invisible data against concurrent access, other than total abstinence.

Secondly, that C++ objects contain code is only an illusion!  Member functions
are not really contained in the object; they are merely code which operates on
an object. They are bound to that object's type using class scope, but that's
only a translation and linkage time concept.

>So shurely with C++ objects, I
>don't need to worry about concurrent code running as each thread will
>actually be running its own seperate objects and hense code?

Whether or not that is the case depends on the design of your multi-threaded
C++ program. It's possible and desirable to be able to call the methods
of one object from multiple threads. Then, that object's non-static data
members must be properly guarded against concurrent access.

Sometimes even distinct objects have threading issues, because they share some
substructure with other objects of the same class. For example a string class
in which assignments and copy constructions are handled sharing
reference-counted buffers needs to protect those buffers and their reference
counts against concurrency. Otherwise two threads using separate string objects
that are historically linked by copy construction or assignment will create a
race.

------------------------------

From: [EMAIL PROTECTED] (Kaz Kylheku)
Subject: Re: Why does this leak memory???
Reply-To: [EMAIL PROTECTED]
Date: Thu, 17 May 2001 06:49:01 GMT

On Wed, 16 May 2001 17:30:56 GMT, Jiva DeVoe <[EMAIL PROTECTED]> wrote:
>This program:
>
>#include <stdio.h>
>#include <unistd.h>
>#include <string>
>
>int main()
>{
>  char cBuf[1024];
>  sprintf(cBuf, "%d", getpid());
>  string *sPid = new string(cBuf);
>  
>  delete sPid;
>  return 0;
>}
>
>seems to leak memory when I run it through a memory leak checker (ccmalloc) 
>on Linux.  Does anyone know why it would?
>
>Further, by observing the values in "VmRSS" stored in /proc/<pid>/status
>for this process, it seems to agree with the memory leak debugger that this 
>leaks memory.  WHY??!??

Does this happen when running under the leak checker? Some of these malloc
debuggers keep a list of all the allocations ever made, so that for instance
they can detect when use is made of a block that was freed.  That list grows
longer and longer, causing the memory of the debugged process to go up.
Make sure you examine the VM footprint of the *uninstrumented* application.

Another reason that a program's footprint may grow is that its memory is
becoming fragmented.  Fragmentation is not the same as a leak; memory has not
been lost track of, but free space is in little pieces that can't be used.

------------------------------

From: [EMAIL PROTECTED]
Crossposted-To: comp.os.linux.x,comp.unix.programmer,comp.windows.x,
Subject: Do I need to develop a record and replay facility under X?
Date: 17 May 2001 06:52:33 GMT

Hello,
I have a requirement to either use or develop a record and replay facility
under X-windows.
It needs to record everything that gets displayed on the screen to the user,
and can then be replayed at a later date. I first started developing a
utility that records all the keystrokes and button clicks, and replay them at
a later date by sending these events to our ouplication. However, I have come
to realise that this is not what is required. We are required to be able to
replay these events without invoking our application. 
That is we must be able to replay our recording independent of our application
to be sure that what is replayed is EXACTLY what was shown on the operator
station during the record.
As I see it, there are two ways of doing this. 
1) Record everything on the screen that happens as a movie.
2) Somehow record all the directives from the window manager (or whatever??)
that tells it what to draw on the screen. ie something like "draw rectangle
at position x, y), "display text in dialog box x" etc. That is, record all
the refresh window commands and everything.  (not exactly sure how to do this
or if it's possible).

So my question is twofold: 
1) Is anyone aware of any application that I can use off the shelf to record
exactly what was displayed on the screen (either recorded as a movie or
capturing the draw directives to the screen), and then be able to replay
these recordings at a later date without invoking our application?

2) If there are no such applications available, can anyone point me in the
direction of how I can develop one myself.

Any help will be greatly appreciated. 
Thanks in advance,
Brad.

 -----  Posted via NewsOne.Net: Free (anonymous) Usenet News via the Web  -----
  http://newsone.net/ -- Free reading and anonymous posting to 60,000+ groups
   NewsOne.Net prohibits users from posting spam.  If this or other posts
made through NewsOne.Net violate posting guidelines, email [EMAIL PROTECTED]

------------------------------

From: "Zoran Cutura" <[EMAIL PROTECTED]>
Subject: Re: [Q]What is frame buffer??... Help
Date: Thu, 17 May 2001 09:20:39 +0200
Reply-To: [EMAIL PROTECTED]

Once upon a while "songjg" <[EMAIL PROTECTED]> wrote:

> I want to show Bitmap and Dialog Box on screen Without X.

This is not a very exact requirements list. You have many
different libraries available under linux for such purposes.

> 
> Somebody recommend me to use frame buffer. As I am a beginner
> with linux, I don't know what frame buffer is, and How to use
> it.
> 
> Anyone who knows the answer help me... please..
>

frame buffer is the graphics adapter on its own. Linux
provides a char-device to user programs that represents the
graphics adapters memory. You'll find the device in /dev/fb*
if your kernel was build with framebuffer support.

I wouldn't recommend framebuffer programming to a newbie. :-(

svgalib may be the better alternative.


-- 
Z ([EMAIL PROTECTED])
"LISP  is worth learning for  the profound enlightenment  experience
you will have when you finally get it; that experience will make you
a better programmer for the rest of your days."   -- Eric S. Raymond

------------------------------

From: Chris <[EMAIL PROTECTED]>
Subject: Re: A linuxthreads C++ object question
Date: Thu, 17 May 2001 09:33:59 +0100

Juergen Heinzl wrote:
> 
> Rather on the contrary C++ does know *nothing* about threads and the
> standard C++ lib or STL aren't thread safe, although there are thread
> safe implementations.

As I recall, the _standard_ STL (i.e., the SGI one) is
thread-safe... but unaccountably, the GNU one, which is
largely based on it, is not. (The definition of thread
safe in this context is very specific, and [roughly]
refers to the idea that if you have two containers of the
same type, for instance

        string a;
        string b;

then operations involving only a in one thread will not
screw up operations involving only b in another. If you
want to have two threads operating on the same container,
you still need mutexes.)

-- 
Chris Lightfoot -- chris at ex dash parrot dot com -- www.ex-parrot.com/~chris/
 ``It's is not, it isn't ain't, and it's it's, not its, if you mean it is. If
   you don't, it's its. Then too, it's hers. It isn't her's. It isn't our's
   either. It's ours, and likewise yours and theirs.'' (From `Edpress News')

------------------------------

From: Chris <[EMAIL PROTECTED]>
Subject: Re: how many CPU's?
Date: Thu, 17 May 2001 09:37:25 +0100

Charles Herman wrote:
> 
> Is there a function I can call that will tell me how many CPU's the
> computer has?

This should be a FAQ.

#include <unistd.h>

{
    int nprocs = sysconf(_SC_NPROCESSORS_CONF);
    /* or                _SC_NPROCESSORS_ONLN  */

        /* ... */
}

You can also parse /proc/stat or /proc/cpuinfo, but this
is inadvisable, for two reasons: firstly, the formats of
those `files' may change between kernel revisions,
breaking your code; secondly, it is not at all portable to
other systems. The above is, reasonably.

-- 
Chris Lightfoot -- chris at ex dash parrot dot com -- www.ex-parrot.com/~chris/
 Everything that is not forbidden is compulsory. (Gell-Mann)

------------------------------

From: Josef Moellers <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.x
Subject: Re: How do I make a messagebox??
Date: Thu, 17 May 2001 11:00:07 +0200

Cam Stobbe wrote:
> =

> Does Linux have a function that is equivalent or similar to the
> MessageBox in Windows?
> =

> I am coding a simple application in C. It will not have a full-blown
> GUI. I just want to throw up a message box.
> =

> I am using RedHat 6.2.

I have written a small tk app which just opens a small window with a
message:

#!/bin/bash -
# \
exec wish $0 $@
#
frame .top
label .top.left -bitmap warning -fg red
label .top.text -text "$argv"
label .top.right -bitmap warning -fg red
pack .top.left .top.text .top.right -side left
button .ok -text "Ok" -command exit
pack .top .ok -side top

If you run that in a child process, you get your message box.

HTH,

-- =

Josef M=F6llers (Pinguinpfleger bei FSC)
        If failure had no penalty success would not be a prize
                                                -- T.  Pratchett

------------------------------

From: Josef Moellers <[EMAIL PROTECTED]>
Subject: Re: arrow keys
Date: Thu, 17 May 2001 11:02:56 +0200

Jan Atle Ramsli wrote:
> =

> [EMAIL PROTECTED] wrote:
> >
> > I know this seems like a simple question but what are
> > the ascii values for the up and down arrow keys? I've
> > looked at about 50 ascii charts and I can't find any with
> > the arrow keys. I want to catch them in a curses program
> > using getchar().
> >Whatever you decide to do, you may want to consider adding some timing=
 (maybe a yield() or a little loop for a fraction of a second) to make su=
re that it is really an arrow key you are getting, and not the correspond=
ing sequence of characters, often starting with [Esc]'[' xxx.
> This way, the user can press [Esc] without necessarily going into some
> 'mode' which also must cover 'getting_rest_of_arrow_key_mode' ...

If you write a curses program, the escape sequences are handled by the
curses package. That's what curses is for: handling different terminals
with different sequences for the arrow keys and map them to fixed values
(KEY_UP, KEY_DOWN, KEY_LEFT, KEY_RIGHT, iirc). The timout is also
handled by curses, so just pressing ESC will yield '\033'.

-- =

Josef M=F6llers (Pinguinpfleger bei FSC)
        If failure had no penalty success would not be a prize
                                                -- T.  Pratchett

------------------------------

From: "Karim A." <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.development.system
Subject: xml api
Date: Thu, 17 May 2001 11:13:56 +0200

Hi all,

I'm looking for a XML api that exist both on Linux/Unix and Windows.

Does anyone know ?


Thanks,

Karim




------------------------------

Date: Thu, 17 May 2001 13:28:36 +0400
From: Vyacheslav Burdjanadze <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.development.system
Subject: Re: xml api

"Karim A." wrote:
> 
> Hi all,
> 
> I'm looking for a XML api that exist both on Linux/Unix and Windows.
> 
> Does anyone know ?
> 
> Thanks,
> 
> Karim

search for libxml

------------------------------

From: Lars Luthman <[EMAIL PROTECTED]>
Subject: Re: Create Makefile
Date: Thu, 17 May 2001 11:41:38 +0200

> Nera wrote:
> 
> Hi,
>         I am going to develope my streaming server on Linux Platform
> But the problem I need is to ensure the protability of the source
> code,
> How do I generate Makefile to meet my need?

Take a look at the info pages for automake and autoconf. They will
generate Makefiles and configure scripts for you.


--ll

------------------------------

From: Kasper Dupont <[EMAIL PROTECTED]>
Crossposted-To: alt.os.linux.mandrake,comp.os.linux.development.system
Subject: Re: Newbie programmer
Date: Thu, 17 May 2001 09:56:24 +0000

William Dandreta wrote:
>  The first release costs $1000 but a GPL version should be available via
> download this summer. You might want to checkout the Kylix info on Borland's
> website and the Kylix newsgroup as well.

Where do you have that GPL information from,
the only information I could found was an
article from november 13th november 2000
with the title:

"Borland to Release CLX Under Dual License,
Kylix Will Not be Open Source"

-- 
Kasper Dupont

------------------------------

From: Kasper Dupont <[EMAIL PROTECTED]>
Crossposted-To: 
alt.linux,comp.os.linux.development.system,linux.redhat.devel,linux.redhat.development
Subject: Re: transpareny
Date: Thu, 17 May 2001 10:07:30 +0000

Darren LS wrote:
> 
[...]
> 
> Hi Kasper, thanks but what I would like to do is dump the output to a vacant
> tty terminal for debugging purposes
> 
> Darren

In that case the easiest probably is just to
start it with the open command from the
command line. "man 1 open"

Notice that in some distributions open is not
installed by default. It is really a handy
tool, so just install it from your CD if it
is not already installed.

You could also use /dev/ttyXX instead of
/dev/null in the code from my last post, the
problem is to find the appropriate value for
XX. There is an ioctl to get that number, I
can post some code if you need it.

-- 
Kasper Dupont

------------------------------


** 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 by posting to the
comp.os.linux.development.apps newsgroup.

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-Apps Digest
******************************

Reply via email to