[lazarus] Working with Sockets

matooo at email.si matooo at email.si
Mon Dec 9 10:39:48 EST 2002


Quoting Michael.VanCanneyt at wisa.be:

> 
> 
> On Mon, 9 Dec 2002 matooo at email.si wrote:
> 
> > >     end else
> > >       Inc(x);
> > >     Inc(apos);
> > >   end;
> > >   raise EXMLReadError.Create('In ' + Filename + ' (line ' +
> IntToStr(y)
> > > + ' pos     IntToStr(x) + '): ' + descr);
> > > end;
> > >
> >
> > ups, I missed that one. but I still wonder why jumps out in heavy
> threaded
> > console app. simple app works fine with this exception.
> 
> Because the 1.0 RTL is not thread safe. The exception stack is shared
> across threads, this is what causes your problem. This should be solved
> in
> the 1.1 compiler, but the thread support is not yet stress tested,

ok, i'll wait on that one

> although
> tests seem to indicate that it works fine.
> 

yep, up to 70 threads are working very, very smooth. Tested, except the
exceptions (as funny as it sounds).

> >
> > i guess i'll just work around my way. it's funny i tried two other
> methods that
> > get blown in heavy threading. in simple app they work just fine.
> unfortunatelly
> > simple apps is not what i need. on the other hand major tread doesn't
> cause any
> > problems with exceptions.
> 
> Why not use fork() and child apps ? You should have no problems then.

It will not be as effective as threads as I read.

> You
> can use shared memory to communicate between the threads if you need
> that.

as I pointed out I wanna be more 2.6 compliant, mostly because of second pack of
app, which will run on a completely new server with new kernel (this is
practicaly the only heavy duty app that runs on that server so no problem with
threading amount and I will probably remodel old one too and upgrade kernel).
And threading gives me no headache at all. In fact program never stops and is
always responsive.

as it concerns threaded sockets I can still send a copy (after friday when
debugging will be over, for now test is running smooth for two days in 30
connections). It's merely just inherited components, that make communication
very, very easy to code.

m.

> 
> Michael.
> 
> _________________________________________________________________
>      To unsubscribe: mail lazarus-request at miraclec.com with
>                 "unsubscribe" as the Subject
>    archives at http://www.lazarus.freepascal.org/mailarchives
> 


-------------------
http://www.email.si






More information about the Lazarus mailing list