Re: [fpc-pascal] Is TFPList thread safe?

2014-10-02 Thread Michael Van Canneyt
On Thu, 2 Oct 2014, Xiangrong Fang wrote: Hi, I would like to know if TFPList is thread-safe or not? And if I make a component thread-safe by using critical sections etc. Is the performance penalty noticeable?  TFPList is not thread-safe. You need to use TThreadList if you want a

Re: [fpc-pascal] Is TFPList thread safe?

2014-10-02 Thread Michael Schnell
On 10/02/2014 03:02 AM, Xiangrong Fang wrote: Hi, I would like to know if TFPList is thread-safe or not? And if I make a component thread-safe by using critical sections etc. Is the performance penalty noticeable? For a class, Thread save is not that easily defined. e.g.: It can be fully

Re: [fpc-pascal] how do I get Run Time info from a published method?

2014-10-02 Thread Dennis Poon
Flávio Thanks so much. Dennis ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Reproducible code: DLL calling Firebird crashes

2014-10-02 Thread Mark Morgan Lloyd
Reinier Olislagers wrote: On 30/09/2014 22:05, Mark Morgan Lloyd wrote: Marco van de Voort wrote: In our previous episode, Sven Barth said: It is indeed true that all units are initialized once the main code Reinier: did you get as far as looking in Dynlibs for an error message immediately

Re: [fpc-pascal] Reproducible code: DLL calling Firebird crashes

2014-10-02 Thread Reinier Olislagers
On 02/10/2014 12:19, Mark Morgan Lloyd wrote: Reinier Olislagers wrote: On 30/09/2014 22:05, Mark Morgan Lloyd wrote: Marco van de Voort wrote: In our previous episode, Sven Barth said: It is indeed true that all units are initialized once the main code Reinier: did you get as far as looking

Re: [fpc-pascal] Reproducible code: DLL calling Firebird crashes

2014-10-02 Thread Michael Van Canneyt
On Thu, 2 Oct 2014, Reinier Olislagers wrote: On 02/10/2014 12:19, Mark Morgan Lloyd wrote: Reinier Olislagers wrote: On 30/09/2014 22:05, Mark Morgan Lloyd wrote: Marco van de Voort wrote: In our previous episode, Sven Barth said: It is indeed true that all units are initialized once

Re: [fpc-pascal] Free Pascal Directories

2014-10-02 Thread Brian
Thanks for all the commandline suggestions , but my question is about using Geany as the IDE , not running the compiler from the commandline. BTW : I only use fpGUI as an example to illustrate the issue. Using Geany as the IDE : The FPC documentation is not correct : 1.3.38 $UNITPATH : Specify

Re: [fpc-pascal] Free Pascal Directories

2014-10-02 Thread Jonas Maebe
On 02 Oct 2014, at 15:30, Brian wrote: Thanks for all the commandline suggestions , but my question is about using Geany as the IDE , not running the compiler from the commandline. Geany itself will call the compiler via the command line, so it presumably has ways to specify additional

Re: [fpc-pascal] Is TFPList thread safe?

2014-10-02 Thread Xiangrong Fang
2014-10-02 14:16 GMT+08:00 Michael Van Canneyt mich...@freepascal.org: TFPList is not thread-safe. You need to use TThreadList if you want a thread-safe list. Critical sections use OS calls, so there is always a performance penalty. I think the only thread-critical operation I need is to

Re: [fpc-pascal] Is TFPList thread safe?

2014-10-02 Thread Michael Schnell
On 10/02/2014 08:16 AM, Michael Van Canneyt wrote: Critical sections use OS calls, so there is always a performance penalty. That is what Futex is made for. AFAIR, in Linux, the fpc RTL calls the pthread library mutex... function. This library uses Futex, if the arch supports that, and uses

Re: [fpc-pascal] Is TFPList thread safe?

2014-10-02 Thread Xiangrong Fang
2014-10-02 22:09 GMT+08:00 Michael Schnell mschn...@lumino.de: AFAIR, in Linux, the fpc RTL calls the pthread library mutex... function. This library uses Futex, if the arch supports that, and uses the plain old MUTEX system call if the arch does not support FUTEX. I need my program to work

Re: [fpc-pascal] Free Pascal Directories

2014-10-02 Thread Michael Van Canneyt
On Thu, 2 Oct 2014, Brian wrote: Jonas , thanks very much as I now see what is happening. FPC only searches the specific directory and not any lower level directories. In this case the unit called is in a lower level directory. Is there any way using Geany to add $UNITPATH directives in the

Re: [fpc-pascal] Is TFPList thread safe?

2014-10-02 Thread Xiangrong Fang
2014-10-02 22:23 GMT+08:00 Xiangrong Fang xrf...@gmail.com: 2014-10-02 22:09 GMT+08:00 Michael Schnell mschn...@lumino.de: AFAIR, in Linux, the fpc RTL calls the pthread library mutex... function. This library uses Futex, if the arch supports that, and uses the plain old MUTEX system call

Re: [fpc-pascal] Is TFPList thread safe?

2014-10-02 Thread Jonas Maebe
On 02 Oct 2014, at 15:59, Xiangrong Fang wrote: I think the only thread-critical operation I need is to add item to the list, so I will use critical section myself, not replace TFPList with TThreadList, for simplicity and performance reason... It will make your program unstable (adding an

[fpc-pascal] Again: Use of abstract classes

2014-10-02 Thread silvioprog
Hello, Someone could inform me if there is an entry in bugtracker with references to this topic? http://www.mail-archive.com/fpc-pascal@lists.freepascal.org/msg31061.html Here in FPC 2.6.4 this code compile well, without erros, warnings etc.: TTest = class abstract(TObject) end; ... var

Re: [fpc-pascal] Free Pascal Directories

2014-10-02 Thread Brian
Thanks Michael. Jonas tip allows me to see what is happening when using Geany. In the case of fpGUI , the fpmake creates all the .ppu and .o files and places them in directory ../i386-linux. Using either the wildcard * or absolute name of the directory is ok . The compiler finds (in this

Re: [fpc-pascal] Free Pascal Directories

2014-10-02 Thread Marco van de Voort
In our previous episode, Brian said: Is there any way to tell the compiler to just link existing .ppu and .o files ? There are three things in such case: - compile the immutable packages with -Ur - find actually WHY the compiler doesn't want to use the .ppu's and get to the root of the

Re: [fpc-pascal] Free Pascal Directories

2014-10-02 Thread Brian
Marco , The fpGUI units were recompiled with directive -Ur When the helloworld.pas file is compiled using Geany (with -Ur and -Va) for some reason FPC can't find the unit (fpg_impl.ppu) called by fp_base , even though it is present in the folder with fpb_base. [0.058] Load from FPG_BASE

Re: [fpc-pascal] Again: Use of abstract classes

2014-10-02 Thread Ewald
On 10/02/2014 05:35 PM, silvioprog wrote: Hello, Someone could inform me if there is an entry in bugtracker with references to this topic? This has already been fixed I believe. See http://lists.freepascal.org/pipermail/fpc-devel/2014-July/033930.html for more information. -- Ewald

Re: [fpc-pascal] Again: Use of abstract classes

2014-10-02 Thread silvioprog
On Thu, Oct 2, 2014 at 3:33 PM, Ewald ew...@yellowcouch.org wrote: On 10/02/2014 05:35 PM, silvioprog wrote: Hello, Someone could inform me if there is an entry in bugtracker with references to this topic? This has already been fixed I believe. See

Re: [fpc-pascal] Free Pascal Directories

2014-10-02 Thread Marco van de Voort
In our previous episode, Brian said: The fpGUI units were recompiled with directive -Ur When the helloworld.pas file is compiled using Geany (with -Ur and -Va) for some reason FPC can't find the unit (fpg_impl.ppu) called by fp_base , even though it is present in the folder with fpb_base.

Re: [fpc-pascal] Free Pascal Directories

2014-10-02 Thread Brian
The compiler accepts the directory and loads the first unit fpg_base , but then fails to load the next unit that is called by fpg_base which is fpg_impl . Then it fails. Regards Brian -- View this message in context:

Re: [fpc-pascal] Free Pascal Directories

2014-10-02 Thread silvioprog
On Tue, 30 Sep 2014, Philippe wrote: some days before we had same type of thread ... the problem is -Fu is not recursive! And luckily not. The result would be a disaster ! However, you can use wildcards: -Fu/home/some/dir/* Michael. Can I use {$unitpaht /home/some/dir/*} ? -- Silvio

Re: [fpc-pascal] Free Pascal Directories

2014-10-02 Thread Brian
My mistake ... Using directive -Va I can see that PFC cannot find fpg_base also. Question : Does the directive $UNITPATH acvtually work ? Regards Brian -- View this message in context: http://free-pascal-general.1045716.n5.nabble.com/Free-Pascal-Directories-tp5720212p5720266.html Sent from

Re: [fpc-pascal] Free Pascal Directories

2014-10-02 Thread Philippe
bad ideia : (with windows we have a limite from the command line size!) I copy recursively all the files from directories I need in a unique directory ... then compile from it!!! ugly! ... may be ... but it works !!! recursively!!! and it is quite fast to copy ... and I spent time in

Re: [fpc-pascal] Free Pascal Directories

2014-10-02 Thread Brian
Conclusion : Using {$UNITPATH /home/some/*} in the main program DOES NOT WORK ! When using Geany if the directive is added in Set Build Command , COMPILE line as -Fu/home/some/* it works properly. Much better than dumping everything into one pot. Regards Brian -- View this message in

Re: [fpc-pascal] Free Pascal Directories

2014-10-02 Thread silvioprog
On Thu, Oct 2, 2014 at 5:52 PM, Brian v...@golden.net wrote: Conclusion : Using {$UNITPATH /home/some/*} in the main program DOES NOT WORK ! [...] =( -- Silvio Clécio My public projects - github.com/silvioprog ___ fpc-pascal maillist -

Re: [fpc-pascal] Free Pascal Directories

2014-10-02 Thread Jonas Maebe
On 02/10/14 22:52, Brian wrote: Conclusion : Using {$UNITPATH/home/some/*} in the main program DOES NOT WORK ! It behaves exactly as documented at http://www.freepascal.org/docs-html/prog/progsu121.html : Note that this switch does not propagate to other units, i.e. it’s scope is limited

Re: [fpc-pascal] Free Pascal Directories

2014-10-02 Thread silvioprog
On Thu, Oct 2, 2014 at 6:13 PM, Jonas Maebe jonas.ma...@elis.ugent.be wrote: On 02/10/14 22:52, Brian wrote: Conclusion : Using {$UNITPATH/home/some/*} in the main program DOES NOT WORK ! It behaves exactly as documented at http://www.freepascal.org/ docs-html/prog/progsu121.html :

Re: [fpc-pascal] Free Pascal Directories

2014-10-02 Thread Jonas Maebe
On 02/10/14 23:23, silvioprog wrote: On Thu, Oct 2, 2014 at 6:13 PM, Jonas Maebe jonas.ma...@elis.ugent.be mailto:jonas.ma...@elis.ugent.be wrote: Note that this switch does not propagate to other units, i.e. it’s scope is limited to the current unit. unit should be interpreted as

Re: [fpc-pascal] Free Pascal Directories

2014-10-02 Thread silvioprog
On Thu, Oct 2, 2014 at 6:34 PM, Jonas Maebe jonas.ma...@elis.ugent.be wrote: On 02/10/14 23:23, silvioprog wrote: On Thu, Oct 2, 2014 at 6:13 PM, Jonas Maebe jonas.ma...@elis.ugent.be mailto:jonas.ma...@elis.ugent.be wrote: Note that this switch does not propagate to other units, i.e.

Re: [fpc-pascal] Free Pascal Directories

2014-10-02 Thread Mattias Gaertner
On Thu, 2 Oct 2014 18:40:01 -0300 silvioprog silviop...@gmail.com wrote: [...] But it would be an nice feature in Free Pascal, something like the import of Python and Java. =) Java requires a CLASSPATH for the imports to work, does it not? Mattias

Re: [fpc-pascal] Free Pascal Directories

2014-10-02 Thread silvioprog
On Thu, Oct 2, 2014 at 6:51 PM, Mattias Gaertner nc-gaert...@netcologne.de wrote: On Thu, 2 Oct 2014 18:40:01 -0300 silvioprog silviop...@gmail.com wrote: [...] But it would be an nice feature in Free Pascal, something like the import of Python and Java. =) Java requires a CLASSPATH

Re: [fpc-pascal] Free Pascal Directories

2014-10-02 Thread Sven Barth
Am 02.10.2014 22:25 schrieb Philippe phili...@quarta.com.br: bad ideia : (with windows we have a limite from the command line size!) If you can't work with 8000 characters then simply use a cfg file and pass that. It's not as if you change your paths every hour... Regards, Sven

Re: [fpc-pascal] Is TFPList thread safe?

2014-10-02 Thread Xiangrong Fang
2014-10-02 23:07 GMT+08:00 Jonas Maebe jonas.ma...@elis.ugent.be: On 02 Oct 2014, at 15:59, Xiangrong Fang wrote: It will make your program unstable (adding an element to an fplist can cause the entire internal array to move, so if you are in the middle of a read operation at the same time,

Re: [fpc-pascal] Free Pascal Directories

2014-10-02 Thread Philippe
@cfg I read about that option in a previous message of the thread ... clearly a better ideia!!! ... I´ll use it for sure! taking advantage of the oportunity. when one type fpc in the command line, he/she gets: D:psl9c9fpc Free Pascal Compiler version 2.6.4 [2014/03/06] for i386 Copyright