[fpc-pascal] TThread.Suspend under Linux

2007-06-02 Thread Graeme Geldenhuys
Hi, I got most of my Thread Manager demo written. While trying out a few features I noticed that every time as Suspend a thread, my app is killed. Running it through gdb I get the following output. -- (gdb) run Starting program: /home/graemeg/programming/

Re: [fpc-pascal] TThread.Suspend under Linux

2007-06-02 Thread Micha Nelissen
Graeme Geldenhuys wrote: > I got most of my Thread Manager demo written. While trying out a few > features I noticed that every time as Suspend a thread, my app is > killed. Running it through gdb I get the following output. I don't see it being killed from your output, or am I missing something

Re: [fpc-pascal] TThread.Suspend under Linux

2007-06-02 Thread Graeme Geldenhuys
The GUI in frozen after that. Unresponsive, doesn't repaint, etc... I have to kill it with 'xkill' and click on the form. If I run the app it from the console (not via gdb) as such... $> ./MultiTheadDemo It doesn't return to the prompt while the app is running, which is correct. I didn't speci

Re: [fpc-pascal] Standby socket servers?

2007-06-02 Thread ik
Hi, You can create a daemon is several ways, but here are two of them: 1. Create non blocking sockets for the server, and on every new communication open a new thread that will use that connection. 2. Create a non blocking sockets for the server, and on every new communication open a new process

Re: [fpc-pascal] TThread.Suspend under Linux

2007-06-02 Thread Jonas Maebe
On 02 Jun 2007, at 10:10, Graeme Geldenhuys wrote: The GUI in frozen after that. Unresponsive, doesn't repaint, etc... I have to kill it with 'xkill' and click on the form. No, you can also type "fg" to let the process continue. But as soon as I Suspend a thread, it returns me to the promp

Re: [fpc-pascal] TThread.Suspend under Linux

2007-06-02 Thread Jonas Maebe
On 02 Jun 2007, at 12:35, Jonas Maebe wrote: Of course, since Windows provides such functionality, people nevertheless depend on this. But when creating cross-platform code, it's clearly a very bad idea (and several of the caveats mentioned above can of course also hold true under Windows)

Re: [fpc-pascal] TThread.Suspend under Linux

2007-06-02 Thread Graeme Geldenhuys
On 6/2/07, Jonas Maebe <[EMAIL PROTECTED]> wrote: > The GUI in frozen after that. Unresponsive, doesn't repaint, etc... I > have to kill it with 'xkill' and click on the form. No, you can also type "fg" to let the process continue. Ah, that worked yes... > But as soon as I > Suspend a threa

Re: [fpc-pascal] TThread.Suspend under Linux

2007-06-02 Thread Jonas Maebe
On 02 Jun 2007, at 13:58, Graeme Geldenhuys wrote: Okay that makes sense. I guess my Thread Manager did actually teach me something then. :-) Don't use .Suspend Just to clarify: don't use .Suspend on another thread. Suspending yourself and letting someone else wake you up again is no pro

Re: [fpc-pascal] TThread.Suspend under Linux

2007-06-02 Thread Michael Van Canneyt
On Sat, 2 Jun 2007, Jonas Maebe wrote: > > On 02 Jun 2007, at 13:58, Graeme Geldenhuys wrote: > > >Okay that makes sense. I guess my Thread Manager did actually teach > >me something then. :-) Don't use .Suspend > > Just to clarify: don't use .Suspend on another thread. Suspending yourself

Re: [fpc-pascal] TThread.Suspend under Linux

2007-06-02 Thread Jonas Maebe
On 02 Jun 2007, at 15:11, Michael Van Canneyt wrote: On Sat, 2 Jun 2007, Jonas Maebe wrote: Just to clarify: don't use .Suspend on another thread. Suspending yourself and letting someone else wake you up again is no problem. Except that it doesn't work on Linux. It should, that uses pla

Re: [fpc-pascal] TThread.Suspend under Linux

2007-06-02 Thread Graeme Geldenhuys
On 6/2/07, Michael Van Canneyt <[EMAIL PROTECTED]> wrote: > Just to clarify: don't use .Suspend on another thread. Suspending yourself and > letting someone else wake you up again is no problem. Except that it doesn't work on Linux. Nope, that works fine here! My worker thread counts down fro

Re: [fpc-pascal] TThread.Suspend under Linux

2007-06-02 Thread Michael Van Canneyt
On Sat, 2 Jun 2007, Graeme Geldenhuys wrote: > On 6/2/07, Michael Van Canneyt <[EMAIL PROTECTED]> wrote: > > > Just to clarify: don't use .Suspend on another thread. Suspending yourself > > > and > > > letting someone else wake you up again is no problem. > > > > Except that it doesn't work on L

[fpc-pascal] Serial Programming

2007-06-02 Thread Rainer Stratmann
Hello, porting to the new 2.1.4 Version, I tried to convert the serial stuff, because there is nomore oldlinux unit. I can not find the equivalent unit(s) for the serial stuff. Is there someone who is serial interface experienced? Kind regards Rainer

Re: [fpc-pascal] Standby socket servers?

2007-06-02 Thread Francisco Reyes
ik writes: You can create a daemon is several ways, but here are two of them: 1. Create non blocking sockets for the server, and on every new communication open a new thread that will use that connection. Thread or fork? 2. Create a non blocking sockets for the server, and on every new commu

Re: [fpc-pascal] Standby socket servers?

2007-06-02 Thread Alan Krause
Francisco Reyes wrote: Do you know of any place, or sample code, that I can see how non blocking sockets work? Francisco, The "bible" on this type of programming is Richard Steven's _Unix Network Programming_. I have both the old version of the book, as well as Volume 1 of the new and revis

[fpc-pascal] Version 2.1.4

2007-06-02 Thread Rainer Stratmann
Hello, 1. var s:string; ... s[1]:='#'; --> causes an access violation 2. Why is it no more possible to assign the length index s[0] in a string? I find that is too much security to supress that. It is cutting responsibility from the programmers. Kind regards, Rainer ___

[fpc-pascal] scope of defining $mode

2007-06-02 Thread David Pethes
Hi, I wanted to ask about $mode global directive scope. According to http://www.freepascal.org/docs-html/prog/progse3.html#x73-710001.2, "Global directives affect the whole of the compilation process". Yet, when I have two units like this: //prog.pas {$mode delphi} program prog; uses uni; fu

Re: [fpc-pascal] Version 2.1.4

2007-06-02 Thread Florian Klaempfl
Rainer Stratmann schrieb: > Hello, > > 1. > > var s:string; > ... > s[1]:='#'; --> causes an access violation > > 2. > > Why is it no more possible to assign the length index s[0] in a string? > I find that is too much security to supress that. > It is cutting responsibility from the progra

Re: [fpc-pascal] Version 2.1.4

2007-06-02 Thread Peter Vreman
At 19:58 2-6-2007, you wrote: Hello, 1. var s:string; ... s[1]:='#'; --> causes an access violation 2. Why is it no more possible to assign the length index s[0] in a string? I find that is too much security to supress that. It is cutting responsibility from the programmers. You are usi

Re: [fpc-pascal] Version 2.1.4

2007-06-02 Thread Rainer Stratmann
Am Samstag, 2. Juni 2007 19:59 schrieb Peter Vreman: > At 19:58 2-6-2007, you wrote: > >Hello, > > > >1. > > > >var s:string; > >... > >s[1]:='#'; --> causes an access violation > > > >2. > > > >Why is it no more possible to assign the length index s[0] in a string? > >I find that is too much s

Re: [fpc-pascal] Version 2.1.4

2007-06-02 Thread Florian Klaempfl
Rainer Stratmann schrieb: > Am Samstag, 2. Juni 2007 19:59 schrieb Peter Vreman: >> At 19:58 2-6-2007, you wrote: >>> Hello, >>> >>> 1. >>> >>> var s:string; >>> ... >>> s[1]:='#'; --> causes an access violation >>> >>> 2. >>> >>> Why is it no more possible to assign the length index s[0] in a

[fpc-pascal] Unit for working with Lists, Double Linked Lists and Stacks

2007-06-02 Thread Catalin Zamfir Alexandru
Hello, Just wanted to contribute my two cents with this homemade Unit [attached to the mail] for working with: - Simple Linked Lists; - Double Linked Lists; - Stacks; Don't know of any other unit that does this, but think it is of use to the day-to-day Pascal developer. Feedba

Re: [fpc-pascal] Version 2.1.4

2007-06-02 Thread Rainer Stratmann
Am Samstag, 2. Juni 2007 20:16 schrieb Florian Klaempfl: > > How can I assign "normal" pascalstrings? > > shortstring > what does var s:string[12]; in delphimode mean? ansistring or shortstring? if ansistring, how can I get access to a "normal" pascal (short)string with maximum length of 12? va

Re: [fpc-pascal] Version 2.1.4

2007-06-02 Thread Florian Klaempfl
Rainer Stratmann schrieb: > Am Samstag, 2. Juni 2007 20:16 schrieb Florian Klaempfl: >>> How can I assign "normal" pascalstrings? >> shortstring >> > what does > > var s:string[12]; > > in delphimode mean? > ansistring or shortstring? > if ansistring, how can I get access to a "normal" pascal (sh

Re: [fpc-pascal] Version 2.1.4

2007-06-02 Thread Rainer Stratmann
Am Samstag, 2. Juni 2007 20:45 schrieb Florian Klaempfl: > Rainer Stratmann schrieb: > > Am Samstag, 2. Juni 2007 20:16 schrieb Florian Klaempfl: > >>> How can I assign "normal" pascalstrings? > >> > >> shortstring > > > > what does > > > > var s:string[12]; > > > > in delphimode mean? > > ansistri

Re: [fpc-pascal] Version 2.1.4

2007-06-02 Thread Michael Van Canneyt
On Sat, 2 Jun 2007, Rainer Stratmann wrote: > Am Samstag, 2. Juni 2007 19:59 schrieb Peter Vreman: > > At 19:58 2-6-2007, you wrote: > > >Hello, > > > > > >1. > > > > > >var s:string; > > >... > > >s[1]:='#'; --> causes an access violation > > > > > >2. > > > > > >Why is it no more possible

Re: [fpc-pascal] Version 2.1.4

2007-06-02 Thread Michael Van Canneyt
On Sat, 2 Jun 2007, Rainer Stratmann wrote: > Am Samstag, 2. Juni 2007 20:16 schrieb Florian Klaempfl: > > > How can I assign "normal" pascalstrings? > > > > shortstring > > > what does > > var s:string[12]; > > in delphimode mean? > ansistring or shortstring? > if ansistring, how can I get ac

Re: [fpc-pascal] Serial Programming

2007-06-02 Thread Luca Olivetti
En/na Rainer Stratmann ha escrit: Hello, porting to the new 2.1.4 Version, I tried to convert the serial stuff, because there is nomore oldlinux unit. I can not find the equivalent unit(s) for the serial stuff. Is there someone who is serial interface experienced? I've used synaser in the pa

Re: [fpc-pascal] Version 2.1.4

2007-06-02 Thread Rainer Stratmann
Am Samstag, 2. Juni 2007 20:54 schrieb Michael Van Canneyt: > On Sat, 2 Jun 2007, Rainer Stratmann wrote: > > Am Samstag, 2. Juni 2007 20:16 schrieb Florian Klaempfl: > > > > How can I assign "normal" pascalstrings? > > > > > > shortstring > > > > what does > > > > var s:string[12]; > > > > in delp

Re: [fpc-pascal] Serial Programming

2007-06-02 Thread Lukas Gebauer
> I've used synaser in the past (and I plan using it again): > > http://synapse.ararat.cz/ See for Synaser version hidden in latest SynaSnap package too. This new testing version have removed Libc dependency on Freepascal, it is usable on Win32 and many linux/unix based platforms. -- Lukas Geb

Re: [fpc-pascal] Standby socket servers?

2007-06-02 Thread Francisco Reyes
Alan Krause writes: The "bible" on this type of programming is Richard Steven's _Unix Network Programming_. I have both the old version of the book, as well as Volume 1 of the new and revised version. Thanks. Got it on Safari. UNIX Network Programming Volume 1, Third Edition: The Sockets Net

[fpc-pascal] initialization and finalization of units?

2007-06-02 Thread Francisco Reyes
Looking at units in ref.pdf I see an initialization and a finalization section. How are those used? ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] initialization and finalization of units?

2007-06-02 Thread David Pethes
Hi, Francisco Reyes wrote: Looking at units in ref.pdf I see an initialization and a finalization section. How are those used? the code in initialization part will be executed right after you run your program, before the main begin..end, and the code in finalization section will be execute