Linux-Development-Sys Digest #931, Volume #7      Sat, 3 Jun 00 19:13:14 EDT

Contents:
  Re: Linux pthreads and a safe read/write with timeout (Christian Plattner)
  Re: Why compiling "-static" creates HUGE binary??? (Herb Dieben)
  Re: awful performance of SysV shared memory on Linux (Juergen Heinzl)
  Re: Need ideas for university funded project for linux (M Sweger)
  Sound Programming - Where to start (Scott Hunter)
  Where to get Java Compiler (Tandem Guy)
  Re: Where to get Java Compiler ("Peter T. Breuer")
  Re: Linux pthreads and a safe read/write with timeout (Kaz Kylheku)
  Re: Stupid but annoying problem (Erik de Castro Lopo)
  kernel_thread and userland programs (eric)
  Re: Where to get Java Compiler (Nate Eldredge)
  Re: Where to get Java Compiler (KK)
  please need urgent help ("Ibrahim hamouda")
  Re: Linux pthreads and a safe read/write with timeout (Xavier Leroy)
  help - max and min in 16 bits signed ("TheOne")
  posix threads ("Pankaj Ratan Lal")
  Re: Why compiling "-static" creates HUGE binary??? (Dr H. T. Leung)
  Re: Why compiling "-static" creates HUGE binary??? (Don Waugaman)
  Re: Sound Programming - Where to start (Matthew Palmer)
  Re: Sound Programming - Where to start (4Front Technologies)
  Raw sockets broken in 2.4.0test1? (Bill Davidsen)

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

From: Christian Plattner <[EMAIL PROTECTED]>
Subject: Re: Linux pthreads and a safe read/write with timeout
Date: Sat, 03 Jun 2000 02:08:18 +0200


earm, sorry, update:

we _must_ put the socket in nonblocking mode, because we do not
know how man data has arrived, we only now THAT something has arrived.

one must put the select sequence in front of each read call.

- Christian

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

From: [EMAIL PROTECTED] (Herb Dieben)
Subject: Re: Why compiling "-static" creates HUGE binary???
Date: 3 Jun 2000 00:34:15 GMT
Reply-To: [EMAIL PROTECTED] (Herb Dieben)

Dave Platt ([EMAIL PROTECTED]) writes:
> In article <b5uZ4.1274$[EMAIL PROTECTED]>,
> RM <[EMAIL PROTECTED]> wrote:
>>Thanks.  I did "strip test", and it did reduce the size considerably.  The
>>striped file is now 205KB.  Better, but still....
> 
 

Follow up responses were quite educational _for me_ but may i remind
people that non addressed memory may fail without consequences whereas ....
I am thinking reliability here.
A soft hardware guy.


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

From: [EMAIL PROTECTED] (Juergen Heinzl)
Crossposted-To: comp.os.linux.development
Subject: Re: awful performance of SysV shared memory on Linux
Date: Sat, 03 Jun 2000 00:54:13 GMT

In article <8h9356$ais$[EMAIL PROTECTED]>, Mladen Adamovic wrote:
>I create 4 processes and comunicate with them using shared memory for doing
>pseudo-concurrent executation of program equivalent to this one:
[...]
>Time to execute this program presudo-concurrent was 10 minutes!!!
>See attach.
>
>Is SysV concepts of IPC  under Linux implemented so bad, or I am wrong?
[...]

On a single CPU PII with 200MHz it took about 1.08 seconds to run. Mind
at the time of running it this machine had been pretty much unloaded, just
24 processes and the memory usage had been low too, about 78 meg free.

I only can think of three reasons at the moment -
* (very) low memory
* (very) high load
* (very) very bad connection, read printf() is expensive and if not run
  on the console the it might result in blocked writes. Now even then 10
  minutes seems to be a wee bit long.

If possible try on some other machine or make sure the machine in question
is not down to its knees.

Ta',
Juergen

-- 
\ Real name     : J�rgen Heinzl                 \       no flames      /
 \ EMail Private : [EMAIL PROTECTED] \ send money instead /

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

From: [EMAIL PROTECTED] (M Sweger)
Crossposted-To: 
comp.os.linux,comp.os.linux.development,comp.os.linux.development.apps,comp.os.linux.misc
Subject: Re: Need ideas for university funded project for linux
Date: 3 Jun 2000 02:24:16 GMT
Reply-To: [EMAIL PROTECTED]

Anybody having an accout with this ISP get the NEWS service to work?
I'm using the news reader tin with the following file:
.newsauth
news.smartworld.net username password

where username/pasword are those used for this ISP you mention below.

Thanks for the info. I haven't been able to get to the News server
at all. I get connection timed out even though the environment variable
NNTPSERVER is also set to "news.smartworld.net".

I've even tried "lynx news://news.smartworld.net" and login with
my username/password and all this does is hang forever.

Scott ([EMAIL PROTECTED]) wrote:

: >I also don't see how support by free ISPs is any kind of indicator of
: >the quality of technology.  I wouldn't touch those free ISPs with a 20 
: >meter, high voltage catle prod.
: Ahemm...
: try www.teledyn.com for a free isp that supports ONLY linux.

--
        Mike,
        [EMAIL PROTECTED]


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

From: Scott Hunter <[EMAIL PROTECTED]>
Subject: Sound Programming - Where to start
Date: Fri, 02 Jun 2000 20:45:41 -0700

I want to make a tone generator on my linux system and
I'm looking around for some tips on where to get started. 

Can I do this by making calls directly to the kernel or
should I use OSS or something else?

TIA


-- 

Scott Hunter

[EMAIL PROTECTED]
http://www.surrealistic.org

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

From: Tandem Guy <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.development.apps,comp.os.linux.misc
Subject: Where to get Java Compiler
Date: Sat, 03 Jun 2000 05:07:56 GMT

Hello.  I'm pretty new to linux (redhat 6.0) and am interested in
learning java.  Where can I get a free java compiler to run on linux?
Thanks in advance for any help anyone can offer.

Tandem Guy


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

From: "Peter T. Breuer" <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.development.apps,comp.os.linux.misc
Subject: Re: Where to get Java Compiler
Date: 3 Jun 2000 05:32:17 GMT

In comp.os.linux.misc Tandem Guy <[EMAIL PROTECTED]> wrote:
: Hello.  I'm pretty new to linux (redhat 6.0) and am interested in
: learning java.  Where can I get a free java compiler to run on linux?

Everywhere. Several such come with most distros. Which one do you want? 

Try www.blackdown.org.

Peter

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

From: [EMAIL PROTECTED] (Kaz Kylheku)
Subject: Re: Linux pthreads and a safe read/write with timeout
Reply-To: [EMAIL PROTECTED]
Date: Sat, 03 Jun 2000 05:54:23 GMT

On Sat, 03 Jun 2000 02:08:18 +0200, Christian Plattner <[EMAIL PROTECTED]>
wrote:
>
>earm, sorry, update:
>
>we _must_ put the socket in nonblocking mode, because we do not
>know how man data has arrived, we only now THAT something has arrived.
>
>one must put the select sequence in front of each read call.

You can use select to tell when data is available for reading on a blocking
socket. The subsequent read will return whatever is available, up to your
buffer size, without blocking. However, if you are *writing* data, you do need
the socket ot be non-blocking; you don't know how much space is in it, and if
your write request is too large, it will block even if it selected positive for
a write.   You still have to deal with truncated writes; e.g. socket selects
positive for writes, you write 4096 bytes, it returns 1024.  You have to keep
the remaining 3072 somewhere and try again.

Secondly, you don't need to put a select sequence in front of each read call.
I sometimes use the technique of doing more than one consecutive non-blocking
read. The program will keep doing this until read returns -1/EWOULDBLOCK, and
only then resort to select or poll.  This has the advantage that when data is
arriving rapidly or in large bursts, then it's dequeued by successive calls to
read, without intervening calls to select. So when the program is being
flooded, system call overhead is cut nearly in half---at the cost that there
are more system calls when the input flow is light: good read, failed read,
select, good read, failed read, select ...

-- 
#exclude <windows.h>

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

From: Erik de Castro Lopo <[EMAIL PROTECTED]>
Subject: Re: Stupid but annoying problem
Date: Sat, 03 Jun 2000 06:10:56 +0000

Robichaud, Jean-Philippe [BAN:6S33:EXCH] wrote:
> 
> Hi
> 
> This is not a developpement problem directly but I gives me a hard
> developping on my linux box.  My linux box is in a lab somewhere else in
> the building and I work on it by doing telnet.  Each time I wish to
> telnet the linux box, it takes about 50-70 second before I have the
> login prompt.  Does anybody know what is wrong ?  If I telnet another
> machine, i just work great...

The telnet server program is doing an nslookup on your IP address.
Its basically a DNS problem and without knowing more about your
network I can't really help (and maybe not even then :-)).

Erik
-- 
+-------------------------------------------------+
     Erik de Castro Lopo     [EMAIL PROTECTED]
+-------------------------------------------------+
With 22,100,000 legitimate businesses in the US alone,
allowing each to send only one UCE per *year* gets every 
mailbox 60,547 emails per day. There will either be email 
without UCE or there will be no email.

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

From: eric <[EMAIL PROTECTED]>
Subject: kernel_thread and userland programs
Date: Sat, 03 Jun 2000 06:45:32 GMT

hi,

i wish to call a userland daemon from my kernel module, but i've had no
luck so far.  I've corrupted my disk a number of times in the process.
ive tried using the technique in kernel/kmod.c to no avail. have a look:

#include <linux/module.h>
#include <linux/fs.h>

void start_exec(void *none)
{
    set_fs(KERNEL_DS)
   // should i use do_execve here or a function ptr to
sys_call_table[__NR_execve]
   // and then call execve ? or what? plz help!
   // i simply want to execve /usr/bin/daemon and want the kernel_thread
to terminate when the program
   // userland daemon terminates.
}

int init_module(void)
{
   int pid;

   pid = kernel_thread(start_exec,NULL,0);
   return(0);
}

void cleanup_module(void)
{

}
// EOF

I have not seen this documented anywhere.
thnx in advance.


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

From: Nate Eldredge <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.development.apps,comp.os.linux.misc
Subject: Re: Where to get Java Compiler
Date: 02 Jun 2000 23:50:18 -0700

Tandem Guy <[EMAIL PROTECTED]> writes:

> Hello.  I'm pretty new to linux (redhat 6.0) and am interested in
> learning java.  Where can I get a free java compiler to run on linux?
> Thanks in advance for any help anyone can offer.

http://www.blackdown.org  (no source)

-- 

Nate Eldredge
[EMAIL PROTECTED]

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

Crossposted-To: comp.os.linux.development.apps,comp.os.linux.misc
Subject: Re: Where to get Java Compiler
From: [EMAIL PROTECTED] (KK)
Date: Sat, 03 Jun 2000 07:38:03 GMT

[posted and mailed]

[EMAIL PROTECTED] (Tandem Guy) wrote in 
<[EMAIL PROTECTED]>:

>Hello.  I'm pretty new to linux (redhat 6.0) and am interested in
>learning java.  Where can I get a free java compiler to run on linux?
>Thanks in advance for any help anyone can offer.
>
>Tandem Guy
>


http://java.sun.com
(Java v1.2.2)

and

http://www.ibm.com

(v1.1.8 AND v1.3 beta)

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

From: "Ibrahim hamouda" <[EMAIL PROTECTED]>
Subject: please need urgent help
Date: Sat, 03 Jun 2000 08:07:11 GMT

the following is a tcpdump output for a telnet session.
Could somebody explain it please

01:05:53.405746 10.1.1.1.1154 > electrob-0k7rpm.electrodomain.com.23: S
1657450558:1657450558(0) win 32760 <mss 1560,sackOK,timestamp
14828480[|tcp]> (DF) [tos 0x10]
01:05:53.405929 electrob-0k7rpm.electrodomain.com.23 > 10.1.1.1.1154: R
0:0(0) ack 1657450559 win 0
01:05:56.402128 10.1.1.1.1154 > electrob-0k7rpm.electrodomain.com.23: S
1657450558:1657450558(0) win 32760 <mss 1560,sackOK,timestamp
14828780[|tcp]> (DF) [tos 0x10]
01:05:56.402254 electrob-0k7rpm.electrodomain.com.23 > 10.1.1.1.1154: R
0:0(0) ack 1 win 0
01:06:02.404331 10.1.1.1.1154 > electrob-0k7rpm.electrodomain.com.23: S
1657450558:1657450558(0) win 32760 <mss 1560,sackOK,timestamp
14829380[|tcp]> (DF) [tos 0x10]
01:06:02.404506 electrob-0k7rpm.electrodomain.com.23 > 10.1.1.1.1154: R
0:0(0) ack 1 win 0
01:06:14.401682 10.1.1.1.1154 > electrob-0k7rpm.electrodomain.com.23: S
1657450558:1657450558(0) win 32760 <mss 1560,sackOK,timestamp
14830580[|tcp]> (DF) [tos 0x10]
01:06:14.401861 electrob-0k7rpm.electrodomain.com.23 > 10.1.1.1.1154: R
0:0(0) ack 1 win 0


Ibrahim Hamouda





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

From: [EMAIL PROTECTED] (Xavier Leroy)
Subject: Re: Linux pthreads and a safe read/write with timeout
Date: 03 Jun 2000 10:05:16 +0200


<[EMAIL PROTECTED]> writes:

>    pthread_testcancel();
>    retcode = read(fd, buffer, length);
>    pthread_testcancel();
> but what happens if the signals is beeing delivered _between_ the first
> pthread_testcancel() and the read call?
> I think the signal will get "lost", since the read call is not a
> cancelation point. -> there will be no timeout on the read?!?

You're correct, this won't work reliably.  I think the following
should do the job: just switch to async cancel mode for the duration
of the blocking system call.  E.g:

        pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, &oldtype);
        pthread_testcancel();
        retcode = read(fd, buffer, length);
        pthread_setcanceltype(oldtype, NULL);

The pthread_testcancel() on the second line may not be necessary
(I don't have the POSIX standard handy to check whether setting the
cancel type to asynchronous while there is a cancellation pending will
honor the cancellation immediately), but it doesn't hurt.

This said, if you need precise control of timeouts on the read()
and write() system calls, you might be better off using select() as
Kaz suggested.

- Xavier Leroy
-- 
Valid e-mail address (without the underscores): [EMAIL PROTECTED]
This is a protection against junk mail. Apologies for the inconvenience.
Home page: http://pauillac.inria.fr/~xleroy/

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

From: "TheOne" <[EMAIL PROTECTED]>
Subject: help - max and min in 16 bits signed
Date: Sat, 3 Jun 2000 12:07:26 -0400

in 16 bits signed, is this formula ok

max: (2^n-1)-1
min: -((2^n)-1)

thanks.



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

From: "Pankaj Ratan Lal" <[EMAIL PROTECTED]>
Subject: posix threads
Date: Sat, 3 Jun 2000 22:51:05 +0530


where can I find the source for the thread scheduling algorithms in the
glibc. I am working on a project on thread scheduling and I would like to
experiment with them. Any help here is welcome.

Thanks
Pankaj Ratan Lal



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

From: [EMAIL PROTECTED] (Dr H. T. Leung)
Crossposted-To: alt.os.linux,linux.dev.c-programming,linux.dev.gcc
Subject: Re: Why compiling "-static" creates HUGE binary???
Date: 3 Jun 2000 18:44:08 GMT


Yes, you can do "-Os" for gcc, which is basically "-O2" minus those optimization
that would increase size. From the gcc info pages.  

In article <8h8s21$18tc$[EMAIL PROTECTED]>, [EMAIL PROTECTED] (bill 
davidsen) writes:
|> In article <nqsZ4.1271$[EMAIL PROTECTED]>,
|> RMain <[EMAIL PROTECTED]> wrote:
|> 
|> | with gcc as follows:
|> | 
|> |     gcc -m386 -O2 -Wall -fomit-frame-pointer -static -o test test.c
|> | 
|> | I get a 940KB binary????
|> | 
|> | If I remove "-static" from the command line, the binary reduces to 11.5 KB.
|> 
|>   Strip it, and use the option --strip-all (or try --strip-debug) to get
|> out the symbols. Try less optimization, down to -O0, since one thing the
|> optimizer does in unroll loops.
|> 
|>   I hate to say Microsoft did something right, but their old (v6?)
|> compiler let you choose optimize for speed or size. I don't really see
|> this in gcc.
|> 
|> -- 
|> bill davidsen <[EMAIL PROTECTED]>  CTO, TMR Associates, Inc
|>   "Doing interesting things with little computers since 1979"(tm)
|> The hardest test of maturity is knowing the difference between
|> resisting temptation and missing a once-in-a-lifetime opportunity.
-- 
          --------------------------------------------------
"What you don't care cannot hurt you."            Chap. 7a, AMS-NS

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

From: [EMAIL PROTECTED] (Don Waugaman)
Crossposted-To: alt.os.linux,linux.dev.c-programming,linux.dev.gcc
Subject: Re: Why compiling "-static" creates HUGE binary???
Date: 3 Jun 2000 11:55:21 -0700

In article <8h8s21$18tc$[EMAIL PROTECTED]>,
bill davidsen <[EMAIL PROTECTED]> wrote:
>  I hate to say Microsoft did something right, but their old (v6?)
>compiler let you choose optimize for speed or size. I don't really see
>this in gcc.

gcc has the -Os option which allows optimization for size.  -O[0-9]
options all optimize for speed.
-- 
    - Don Waugaman ([EMAIL PROTECTED])    O-             _|_  Will pun
Web Page: http://www.cs.arizona.edu/people/dpw/            |   for food
In the Sonoran Desert, where we say: "It's a dry heat..."  |     <><
In 1869 the waffle iron was invented for people who had wrinkled waffles.

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

From: [EMAIL PROTECTED] (Matthew Palmer)
Subject: Re: Sound Programming - Where to start
Reply-To: [EMAIL PROTECTED]
Date: 4 Jun 2000 03:10:23 +1000

Scott Hunter is of the opinion:
>I want to make a tone generator on my linux system and
>I'm looking around for some tips on where to get started. 
>
>Can I do this by making calls directly to the kernel or
>should I use OSS or something else?

For a pure tone generator you can use the PC speaker, with appropriate
ioctl()s.  (Sorry, can't remember which ones, and I don't have the LPG -
which is where I found them - with me).


-- 
=======================================================================
#include <disclaimer.h>
Matthew Palmer
[EMAIL PROTECTED]

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

From: 4Front Technologies <[EMAIL PROTECTED]>
Subject: Re: Sound Programming - Where to start
Date: 03 Jun 2000 21:57:38 GMT

Matthew Palmer <[EMAIL PROTECTED]> wrote:
> Scott Hunter is of the opinion:
>>I want to make a tone generator on my linux system and
>>I'm looking around for some tips on where to get started. 
>>
>>Can I do this by making calls directly to the kernel or
>>should I use OSS or something else?

> For a pure tone generator you can use the PC speaker, with appropriate
> ioctl()s.  (Sorry, can't remember which ones, and I don't have the LPG -
> which is where I found them - with me).

Hi,

Look at SndObj library that's listed as the Killer App of the
month at http://www.opensound.com - it has some built in functionality
to generate sine waves and other signal generators.

Best regards
Dev Mazumdar
4Front Technologies
http://www.opensound.com (Home of Open Sound System)

> -- 
> -----------------------------------------------------------------------
> #include <disclaimer.h>
> Matthew Palmer
> [EMAIL PROTECTED]

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

Crossposted-To: comp.os.linux.networking
From: Bill Davidsen <[EMAIL PROTECTED]>
Reply-To: [EMAIL PROTECTED]
Subject: Raw sockets broken in 2.4.0test1?
Date: Sat, 3 Jun 2000 19:00:07 -0400

I was testing a firewall, and tried to run the scan code, nmap-2.53, on a
machine outside the firewall. The machine was on 2.4.0test1, and I got a
bunch of "Operation not permitted" in send_tcp_raw, which didn't give me
failures in earlier kernels, 2.2.13 or 2.3.99pre8.

I tried recompiling nmap under the new kernel, checked that I had the
latest version, checked that all the options in the kernel were enabled,
etc. Looks as if there's something actually broken.

I realize there may be an option in a weird place, the iptables options
are not with the "network features," but down in the "you should not have
to change this" section, so I did look through everything, and didn't see
any more options to run.

I also tried tcpdump, and that works fine.

I built the "test1ac5" patched kernel, worked the same. "test1ac7" did not
compile with my options, and I doubt that's the problem anyway.

Has anyone any thoughts on why this "operation not permitted" is forcing
me back to the 2.2 kernel?
-- 
Bill Davidsen, CTO TMR Associates, Inc
 <[EMAIL PROTECTED]>


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


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

Reply via email to