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

2014-10-06 Thread Michael Schnell
On 10/02/2014 03:59 PM, Xiangrong Fang wrote: , not replace TFPList with TThreadList, for simplicity and performance reason... I don't suppose it will be possible to beat TThreadList performance by any home-brew Pascal code, which is same is not insecure. -Michael

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

2014-10-06 Thread Michael Schnell
On 10/02/2014 04:23 PM, Xiangrong Fang wrote: I need my program to work on both Linux and Windows, can I still use FUTEX? I did not recommend to use FUTEX yourself. Futex is a rather complicated thingy that needs ASM for a combination of atomic user land operations and system calls (that

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

2014-10-06 Thread Michael Schnell
On 10/02/2014 05:03 PM, Xiangrong Fang wrote: For Windows, critical sections are lighter-weight than mutexes. Mutexes can be shared between processes, but always result in a system call to the kernel which has some overhead. Critical sections can only be used within one

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

2014-10-06 Thread Marco van de Voort
In our previous episode, Michael Schnell said: For Critical Sections, FPC has the TCriticalSection object, is there a TMutex object? AFAI understand, CriticalSection is the Delphi/fpc name for POSIX-Mutex. Critical sections are bound to the owning process under Windows, while Windows

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

2014-10-06 Thread Michael Schnell
On 10/06/2014 12:18 PM, Marco van de Voort wrote: So critical section is equal to posix mutex with PTHREAD_PROCESS_PRIVATE attribute. Thanks for the clearness ! (The OP of course just wants just this - synchronization between threads of a single application.) -Michael

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

2014-10-06 Thread Marco van de Voort
In our previous episode, Michael Schnell said: So critical section is equal to posix mutex with PTHREAD_PROCESS_PRIVATE attribute. Thanks for the clearness ! (The OP of course just wants just this - synchronization between threads of a single application.) On *nix for critical section,

[fpc-pascal] Trying to register a Windows Service gives error

2014-10-06 Thread Graeme Geldenhuys
Hi, I created a relatively simple Windows Service Application using FPC 2.6.4. The application imports CSV data from a monitored folder and updates product tables in a MS SQL Server database. The Service Application installed and ran perfectly on my Windows 7 workstation. It also installed and

Re: [fpc-pascal] Trying to register a Windows Service gives error

2014-10-06 Thread Graeme Geldenhuys
On 06/10/2014 11:59, Graeme Geldenhuys wrote: C:\Q-Point\csvimportercsvimporter_service -i exception at 0042CD50: System error, (OS Code 5): Access is denied. Just a quick follow-up... I eventually found the problem (by pure luck). Windows Server is weird! Even though we logged in with an

Re: [fpc-pascal] Trying to register a Windows Service gives error

2014-10-06 Thread Sven Barth
Am 06.10.2014 17:19 schrieb Graeme Geldenhuys ggeldenh...@qts.co.uk: On 06/10/2014 11:59, Graeme Geldenhuys wrote: C:\Q-Point\csvimportercsvimporter_service -i exception at 0042CD50: System error, (OS Code 5): Access is denied. Just a quick follow-up... I eventually found the

Re: [fpc-pascal] Trying to register a Windows Service gives error

2014-10-06 Thread Graeme Geldenhuys
On 06/10/2014 16:36, Sven Barth wrote: That's the case since Windows Vista. Maybe you have disabled UAC Interesting, thanks for mentioning that. I know I've disabled UAC on my work laptop. I'm not in control of our development server, but I'll ask the admin when he is back in the office.

Re: [fpc-pascal] Syserrormessage, parameter data type

2014-10-06 Thread Jürgen Hestermann
Am 2014-10-06 um 07:55 schrieb Sven Barth: On 06.10.2014 07:20, Jürgen Hestermann wrote: Am 2014-10-05 um 20:21 schrieb Sven Barth: Please note that GetLastError is Windows-specific. The cross platform function in SysUtils is called GetLastOSError which does return Integer. And why does a

Re: [fpc-pascal] Free Pascal Directories

2014-10-06 Thread fredvs
Hello. I use Geany and fpGUI for ages now. ;-) All you have to do = In Geany: - Click on Define construct command = In Compile command = fpc %f @extrafpc.cfg extrafpc.cfp is a text file with all your -fu and -fi needed. Here example of a fpGUI extrafpc.cfg = -fPIC

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

2014-10-06 Thread Dennis Poon
Michael Schnell wrote: On 10/02/2014 03:59 PM, Xiangrong Fang wrote: , not replace TFPList with TThreadList, for simplicity and performance reason... I don't suppose it will be possible to beat TThreadList performance by any home-brew Pascal code, which is same is not insecure. But I

Re: [fpc-pascal] Syserrormessage, parameter data type

2014-10-06 Thread Jürgen Hestermann
Am 2014-10-05 um 15:08 schrieb Michael Van Canneyt: A typecast will be needed somewhere. Yes, instead of assigning the two values as in Integer_Type := DWord_Type; MOVE could be used: move(DWord_Type,Integer_Type,sizeof(DWord_Type)); This way no range check would trigger and no bit would

Re: [fpc-pascal] Trying to register a Windows Service gives error

2014-10-06 Thread Sven Barth
Am 06.10.2014 17:45 schrieb Graeme Geldenhuys ggeldenh...@qts.co.uk: On 06/10/2014 16:36, Sven Barth wrote: That's the case since Windows Vista. Maybe you have disabled UAC Interesting, thanks for mentioning that. I know I've disabled UAC on my work laptop. I'm not in control of our

Re: [fpc-pascal] Syserrormessage, parameter data type

2014-10-06 Thread Sven Barth
Am 06.10.2014 17:55 schrieb Jürgen Hestermann juergen.hesterm...@gmx.de: Am 2014-10-06 um 07:55 schrieb Sven Barth: On 06.10.2014 07:20, Jürgen Hestermann wrote: Am 2014-10-05 um 20:21 schrieb Sven Barth: Please note that GetLastError is Windows-specific. The cross platform function