Linux-Development-Sys Digest #31, Volume #8      Wed, 19 Jul 00 10:13:10 EDT

Contents:
  Re: OK for multiple processes block on accept() for a socket? [REPOST] (Michael 
Shell)
  Re: floating point issue (Remco Wouts)
  Re: A good distribution anybody? (Marco van de Voort)
  Re: How to port MSVC++ app to Linux? (Marco van de Voort)
  Re: floating point issue ("Christos D. Antonopoulos")
  Re: bootsect.S in 2.3.21 ! (Marco van de Voort)
  Re: Good Basic compiler for linux? (Marco van de Voort)
  Re: Good Basic compiler for linux? (Marco van de Voort)
  Re: is there a port to windows media player? (Erik de Castro Lopo)
  C problem ("Eric Co")
  Re: Checking socket status (c/c++) (Alexander Riesen)
  Re: Database Modeling Tools for Linux? ("Frank V. Castellucci")
  Re: C problem (Harold Henry)
  Re: My own distribution (Marco van de Voort)
  Re: C problem (China Blue Ribbon Commission)
  Re: My own distribution (Marco van de Voort)
  Re: My own distribution (Mike Dowling)
  Re: strange "mv" bug (Mario Klebsch)

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

From: Michael Shell <[EMAIL PROTECTED]>
Subject: Re: OK for multiple processes block on accept() for a socket? [REPOST]
Date: Wed, 19 Jul 2000 03:09:40 -0400


 Sorry for the awful line breaks! Here is a cleaner post:
****

Hello,

 I have been reading W. Richard Steven's wonderful Unix Network
 Programming books. (He died last year and will be sadly missed).

At anyrate, the book describes a preforked TCP/IP server in which many
children are spawned and all block on an accept() to handle clients
from a single listen() socket. Now, there is the "Thundering herd"
problem where they ALL wake up and only one gets to service the request,
the rest go back to sleep. Nevertheless, overhead of this server is
shown to be less than the other compared architectures. For heavy loads
and lots of busy children, the waking up of the spare servers may not
be such a big thing and locking does involve overhead. There is a
wake_one() function in some UNIX kernels, but I heard it is hard as hell
to code into the Linux kernel.

BSD allows many processes to block on accept() on the same listen()
socket.

SVR4 does not.

Does Linux?

There seems to be some talk of this on the kernal mailing lists back in
1997, but I can find no more info about it. Apache uses this
architecture when it can, but resorts to locks around the accept()'s
when it must. A look at Apache's (1.3.9) source code, shows that they
use multiple blocking accepts() when they can. Furthermore, Linux seems
to require fcntl() locks around the accepts. Say it ain't so!


// Apache exerpt:
/* On some architectures it's safe to do unserialized accept()s
 * in the single Listen case.  But it's never safe to do it in the
 * case where there's multiple Listen statements.  Define
 * SINGLE_LISTEN_UNSERIALIZED_ACCEPT
 * when it's safe in the single Listen case.
 */
#ifdef SINGLE_LISTEN_UNSERIALIZED_ACCEPT


Do the newer Linux kernels still require locks around the accept()'s?

BTW,  if anyone hapens to know, any plans to support POSIX Semaphores
in shared memory via sem_init():
Man exerpt for 2.2-14 kernel:
 >LinuxThreads currently does not support  process-shared  semaphores,
 >thus  sem_init always returns with error ENOSYS if pshared is not
 > zero.

I know the new kernels allow mmap() to be used with SHARED *and*
ANONYMOUS, I wonder if we can use sem_init with shared memory now.


Where can I find info like this on the web besides digging through
archives?


 Thank you in advance,

 Mike Shell
 [EMAIL PROTECTED]




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

Subject: Re: floating point issue
From: Remco Wouts <[EMAIL PROTECTED]>
Date: 19 Jul 2000 09:15:58 +0200

[EMAIL PROTECTED] writes:

> Hi there,
> 
> Is that possible to have floating point caculation in the driver
> module? I wrote a program like this to verify:
No, try to augment your module with a user space program (daemon?)
that receives the raw-data and does the floating point calculations.
You may find that you come-up with a cleaner design for your driver
anyway.

This is the recommended approach for data acquisition cards etc.
-- 
remco

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

From: [EMAIL PROTECTED] (Marco van de Voort)
Subject: Re: A good distribution anybody?
Date: 19 Jul 2000 07:36:18 GMT

>
>I started with version 0.7? of Linux, and have continued ever since
>without using distributions.  I have compiled and configured all the
>software myself.  I am about to loose my direct Internet access, but
>will continue to have modem access.  It will therefore become
>impractical for me to continue as I have.  It would be nice to have a
>good distribution, and to take it from there.  But which one?
>

For you, with your history: Either Slackware (closest to self compiled, and
more flexible) or Debian, with Slackware prefered.

Don't bother to test the other more commercially orientated distributions,
it will give you the same feeling as SUSE.

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

From: [EMAIL PROTECTED] (Marco van de Voort)
Subject: Re: How to port MSVC++ app to Linux?
Date: 19 Jul 2000 07:50:53 GMT

>>Gene Montgomery <[EMAIL PROTECTED]> wrote:
>>>       I would appreciate hearing any tips regarding porting MS-dependent code
>>> to the Linux/GNU world, or a steer to a web site with such information.
>>
>>If it's a gooey app I'm afraid you should consider rolling your own.
>>MSVC++ tends to put app logic code into UI; MFC was not designed with
>>portability in mind (IMO when they designed MFC the mind wasn't there 
>>at all). You may well spend the rest of your life just trying to find
>>model, view & controller in MSVC/MFC app. Then you'll need to re-write
>>the view (UI) part and port model & controller parts. Writing a new 
>>program will probably take much less time and effort. :(
>>YMMV, of course.
>>Dima
>
>Can't that be said of pretty much of OOP in general? 

No. The Delphi classes, though not fully portable, are much better designed,
and need less tweaking. They actually used some of the advantages of OOP
like encapsulation.

Inprise changed the VCL (their classes lib) to be more OS independant,
(though I don't know if that means processor independance too), and names it
CLX. 
What I've heard of it, is that it requires some work to update Delphi
apps, but the problems are mainly in that most apps use the API also
directly, not in the windows dependancy of the Delphi class lib.

> Unless you have
>the classes on the platforms you intend to port to, the OOP advantage
>just isn't there anymore. P

Isn't that always the case? If you port C to a platform without gcc/libc, you
have no portability advantage too.

>Perhaps Microsoft may one day decide to 
>port MFC 
>to Linux; we will then have all the Microsoft apps we can handle!

Don't count on it. THe apps will need too much changing. Linux signals are
different from messages. (I had some problems converting async sockets).
Keeping WINE up to date, and speed it up is probably more time-efficient.


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

From: "Christos D. Antonopoulos" <[EMAIL PROTECTED]>
Subject: Re: floating point issue
Date: Wed, 19 Jul 2000 11:45:55 +0300

[EMAIL PROTECTED] wrote:
> 
> Hi there,
> 
> Is that possible to have floating point caculation in the driver
> module?

It is impossible to do fp math at kernel-level. It has to do with the
way fp registers are handled during context switches. Try to do your fp
math with a user-level program.

Christos Antonopoulos

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

From: [EMAIL PROTECTED] (Marco van de Voort)
Subject: Re: bootsect.S in 2.3.21 !
Date: 19 Jul 2000 09:14:21 GMT

>
>In any case, binutils 2.8.x will no longer work (at least on Intel; the
>other architectures haven't changed).  There is some confusion over
>whether the required version is 2.9.1.something or 2.9.5.something.  I
>have the Debian-packaged 2.9.5 and it works fine.

2.9.1 afaik.

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

From: [EMAIL PROTECTED] (Marco van de Voort)
Subject: Re: Good Basic compiler for linux?
Date: 19 Jul 2000 09:17:48 GMT

>>> >
>>> > I don`t think the person posting the message was ASKING for your opinion on
>>> > BASIC or wished to see a list of your programming conquests.
>>> >
>>> > Visual Basic is used by a great number of people & if linux has a comparable
>>> > application it would help it be adopted more in the real world.

If you are interested in the visual aspect, you'll have to wait until Delphi
comes to Linux in the fall. That is Pascal though. C++ builder will probably
follow soon after.

Since VB is made by Microsoft, I don't expect a Linux port any soon.

>>There is a program called 'xbasic' which is available
>>from http://www.maxreason.com/software/xbasic/linux.html
>>
>>I don't know if it is in any way compatible with MS VB but it
>>certainly qualifies as a Linux Basic system.
>
>a) It doesn't support ActiveX controls, or OLE, or DCOM, or CORBA.

Delphi will support Corba. The rest is afaik not supported by Linux (in the
form it is exists on windows)


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

From: [EMAIL PROTECTED] (Marco van de Voort)
Subject: Re: Good Basic compiler for linux?
Date: 19 Jul 2000 09:18:33 GMT

>:   I think I'll be taking a look at C# anyway, it may well be a standard
>: language five years from now.
>
>We'll see in 5 years from now. However, I hereby predict that
>you won't find open compilers for it, and that most of its useful
>features will come from proprietary libraries.

I think you have a pretty good point here.

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

From: Erik de Castro Lopo <[EMAIL PROTECTED]>
Crossposted-To: 
comp.os.linux.development.apps,comp.os.linux.misc,comp.os.linux.setup,comp.os.linux.x
Subject: Re: is there a port to windows media player?
Date: Wed, 19 Jul 2000 10:00:58 +0000

Dave Blake wrote:
> 
> Stewart Honsberger <[EMAIL PROTECTED]> wrote:
> 
> > He only said that there are plenty of .asp only sources. I
> > offered him an alternative. Since Microsoft isn't being very
> > forthcoming in offering either a port of their product or the
> > structs of their format, I'd just as soon abandon it completely
> > in favour of something more open.
> 
> http://wmformatsdk.smdisp.net/rtm/
> 
> This is the media format software developer kit, of course a
> Windows Executable. But it should provide adequate descriptions
> of the media for the willing.

No it doesn't :-). All it provides are header files and examples for
using the Windows libraries on Windows. It does not in any way 
describe the file format or how to decode/encode the files.

Erik
-- 
+-------------------------------------------------+
     Erik de Castro Lopo     [EMAIL PROTECTED]
+-------------------------------------------------+
Everything that I've learned about computers I have boiled 
down into three principles:
  Unix: You think it won't work, but if you find the right 
        guru, you can make it work.
  Macintosh: You think it will work, but it won't.
  PC/Windows: You think it won't work, and it won't.

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

From: "Eric Co" <[EMAIL PROTECTED]>
Subject: C problem
Date: Wed, 19 Jul 2000 17:49:35 +0800

hi,
in the follow example, when it call strtok, it will got segmentation fault
in Linux,
but with the same code, it won't happen in win32, what is the problem?
i got to use strcpy or strdup to eliminate this prolem.

int main(void){
   char *str = "abc";
   char *brkstr = ",";
   char *s;

   s = strtok(str, brkstr);
}

thanx,
eric co



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

From: Alexander Riesen <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.development
Subject: Re: Checking socket status (c/c++)
Date: Wed, 19 Jul 2000 12:50:49 +0200

just another way to get over "broken pipes":
use send/recv with flags parameter set to MSG_NOSIGNAL.
Now you can disable the signals only for the particular operation,
letting that to be enabled for other calls (that, maybe do need it).

Bhavin Shah <[EMAIL PROTECTED]> wrote:
>> >When I recv data from the socket using "recv()",
>> >the appropriate errno gets set and I can catch
>> >broken connections.  However, when I try and
>> >send to this broken socket with "send", I
>> >get a broken pipe message and my program halts.
>> 
>> That's because you program gets a SIGPIPE signal. You should 
>> either install a
>> handler for this signal, or set the action to SIG_IGN.  If the
>> pipe signal is
>> ignored, then the send will return -1 with errno set to EPIPE,
>> and you can deal
>> with the error.

> Thanks, but one more thing.  If the send is within a thread, I'm 
> assuming that the thread can switch in the middle of the send w/o
> locks or anything.  My question is when the thread switches back to
> where it left off in the send and the connection got broken in between 
> the switching, will the send(upon switching back to the thread) still
> catch the broken connection?

> Bhavin


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

Date: Wed, 19 Jul 2000 07:19:41 -0400
From: "Frank V. Castellucci" <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.development.apps
Subject: Re: Database Modeling Tools for Linux?

Thomas Gagne wrote:
> 
> Does anyone know of any modeling tools like Embarcadero's ER/Studio or CA's
> ER/Win for Linux.  I hate having to flip-flop between Linux and Windows just
> to use a modeling tool.  It's enough to make me look at VMWare...
> 
> --
> For Open Source Middleware Visit http://home.netcom.com/~tgagne

Try:

Dia
ArgoUML (I know, but in a fix...)

-- 
Frank V. Castellucci
http://corelinux.sourceforge.net
OOA/OOD/C++ Standards and Guidelines for Linux
http://PythPat.sourceforge.net
Pythons Pattern Package

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

From: [EMAIL PROTECTED] (Harold Henry)
Subject: Re: C problem
Date: 19 Jul 2000 11:27:01 GMT

[Posted and mailed]

Do a man on strtok

BUGS
       Never use this function.  This function modifies its first
       argument.   The  identity  of  the delimiting character is
       lost.  This function cannot be used on constant strings.




In article <8l3tim$rqj$[EMAIL PROTECTED]>,
        "Eric Co" <[EMAIL PROTECTED]> writes:
> hi,
> in the follow example, when it call strtok, it will got segmentation fault
> in Linux,
> but with the same code, it won't happen in win32, what is the problem?
> i got to use strcpy or strdup to eliminate this prolem.
> 
> int main(void){
>    char *str = "abc";
>    char *brkstr = ",";
>    char *s;
> 
>    s = strtok(str, brkstr);
> }
> 
> thanx,
> eric co
> 
> 

-- 


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

From: [EMAIL PROTECTED] (Marco van de Voort)
Subject: Re: My own distribution
Date: 19 Jul 2000 11:39:27 GMT

>> In a sense, I have always had my own distribution.  I.e., I have never
>> used a distribution.  The advantage for me is obvious; I know where
>> everything is and how it is configured.
><SNIP>
>
>I've been thinking of doing this.  One question, though.  How do you get
>started without a distribution to compile stuff on?

- You take any distribution, install it. Minimal Slackware would be best.

- You download the sources of the base packages which you want to install in
the right version (pacakages like  binutils, gcc, glibc, fpc, kernel, and
utilities as lilo, fdisk etc)

- You compile them.
- package them into a base package. 
- Create the first two stages of your installer.
- Create a installer, preferably using a scripting language noone has ever
        heard before. (or you could be the first to use a binary as
        installer)
- Install the newly generated distribution.
- Compile all other apps, add more configurability, kernel versions.
- Burn a disc
- charge a nominal fee.

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

From: [EMAIL PROTECTED] (China Blue Ribbon Commission)
Subject: Re: C problem
Date: Wed, 19 Jul 2000 03:46:30 -0700

/ in the follow example, when it call strtok, it will got segmentation fault
/ in Linux,
/ but with the same code, it won't happen in win32, what is the problem?
/ i got to use strcpy or strdup to eliminate this prolem.
/ 
/ int main(void){
/    char *str = "abc";
/    char *brkstr = ",";
/    char *s;
/ 
/    s = strtok(str, brkstr);
/ }

I believe strtok tries to modify the string in place to keep its context
between calls. A literal string "abc" is usually put on a read-only page
in unix, so that attempting to modify it will cause a page permission
violation. So, yes, you would have to copy the string to a writable page
yourself, or tell the compiler to put string literals on a writable page.
There's also a version of strtok that passes its context in a third
parameter, but I don't know if that's on Linux. You should check $(man 3
string).

-- 
CACS: Collective Against Consensual Sanity       v0.123
Now a text site map http://www.tsoft.com/~wyrmwif/cacs/
pretty?     http://www.geocities.com/SoHo/Studios/5079/
:)-free zone.     Cthulu in '00: .../cacs/politics.html

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

From: [EMAIL PROTECTED] (Marco van de Voort)
Subject: Re: My own distribution
Date: 19 Jul 2000 11:48:14 GMT

>| I would like to make my own Linux distribution cd wich I could share
>| with others.
>
>Why?  WHat I'm asking is, are you thinking of some idea or philosophy
>that will make your distribution at least distinct, and for people like
>yourself also better, than what's out there now?

We are playing with that too.

Best reason is customisation. We have a lot of very similar laptops here on
the university (several thousand), in  3 or 4 basic variations.

We could configure RedHat on all of them, or create a distribution with 4
profiles for hardware dependant stuff, automatic detection of which one it
is installed upon, and replace unused applications with others that ARE
needed for fair college use (like Gnutella :-)



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

From: [EMAIL PROTECTED] (Mike Dowling)
Subject: Re: My own distribution
Date: 19 Jul 2000 11:50:31 GMT

On Tue, 18 Jul 2000 22:40:37 GMT, Kevin Lacquement <[EMAIL PROTECTED]> wrote:
>I've been thinking of doing this.  One question, though.  How do you get
>started without a distribution to compile stuff on?

In my case, I was handed 15 floppies containing the backup of the entire
Linux system of a friend.  That was version 0.7?.  I took it from there.

Cheers,
Mike

-- 
My email address [EMAIL PROTECTED] above is a valid email address.
It is, in fact, a sendmail alias; the digit 'N' is incremented regularly.
Spammed aliases will be deleted.  Currently, mike[29,30]
are valid.  If email to mikeN bounces, try mikeN+1.

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

From: [EMAIL PROTECTED] (Mario Klebsch)
Subject: Re: strange "mv" bug
Date: Wed, 19 Jul 2000 14:22:25 +0200

[EMAIL PROTECTED] (Daniel R. Grayson) writes:

>Here is a fix.

>-  ep->node = (char *) node;
>+  ep->node = (char *) strdup(node);

Just adding a strdup()? Don't you have to add a matching free()
somwhere to avoid creating a memory leak?

Anyway, mv(1) doesn't normally live long enough to seriously complain
about a memory leak. :-)

73, Mario
-- 
Mario Klebsch                                           [EMAIL PROTECTED]
PGP-Key available at http://www.klebsch.de/public.key
Fingerprint DSS: EE7C DBCC D9C8 5DC1 D4DB  1483 30CE 9FB2 A047 9CE0
 Diffie-Hellman: D447 4ED6 8A10 2C65 C5E5  8B98 9464 53FF 9382 F518

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


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