Re: [fpc-pascal] web app and application persistency

2011-08-01 Thread Andrew Brunner
On Mon, Aug 1, 2011 at 10:07 AM, Gustavo Enrique Jimenez gejime...@gmail.com wrote: Hi:  I send cookies to the client. One of those cookies is a sessionID, a random number generated at login.  My sequence is something like Login Client: username/password -Login html button Server: run cgi

Re: [fpc-pascal] web app and application persistency

2011-08-01 Thread Andrew Brunner
On Mon, Aug 1, 2011 at 10:43 AM, Felipe Monteiro de Carvalho felipemonteiro.carva...@gmail.com wrote: On Mon, Aug 1, 2011 at 5:23 PM, Andrew Brunner andrew.t.brun...@gmail.com wrote: I agree with this one.  The only thing I could add would be AJAX WebSockets for really advanced applications

Re: [fpc-pascal] web app and application persistency

2011-08-01 Thread Andrew Brunner
On Mon, Aug 1, 2011 at 12:05 PM, Michael Van Canneyt mich...@freepascal.org wrote: ..But it is not always supported by the browser (as Marco indicated) and many firewalls simply don't agree with websockets. Can firewalls detect websockets over port 80?

Re: [fpc-pascal] web app and application persistency

2011-08-01 Thread Andrew Brunner
The only thing I can think of would be packet inspection. Firewalls included with Linux and Windows do not perform deep packet inspection. They only allow/deny packets with specific ports over either TCP or UDP. Am I missing something? On Mon, Aug 1, 2011 at 12:31 PM, Michael Van Canneyt

[fpc-pascal] Distributing unit object files

2011-12-15 Thread Andrew Brunner
I'm needing to figure out how best to close or seal units so that I can use the compiled unit object files instead of the actual unit files. The problem is that the compiled unit files call a few units that the project has the source to. And FPC is looking to recompile the compiled object file

[fpc-pascal] Darwin i386 socket polling

2011-12-22 Thread Andrew Brunner
I'm needing to figure out how socket signaling mechanisms work under darwin. Windows and Linux work, Darwin however does not support ePoll. Anyone have any experience with Sockets events under OSX i386? Thanks. ___ fpc-pascal maillist -

Re: [fpc-pascal] Darwin i386 socket polling

2011-12-23 Thread Andrew Brunner
Windows supports epoll? No, windows doesn't offer polling socket mechanisms. They send messages to windows with the socket number - it's event driven. Kernel polling is different, but I assumed that Darwin would support it via e-Poll. I searched and found a few references to kQueue/kEvent.

[fpc-pascal] Unicode support

2012-05-16 Thread Andrew Brunner
I wanted to ask what the present state of unicode support is now. I'm running into problems with some various strings. Sometimes when a string contains a unicode character postgresql won't allow the insert/update. Also, some MP3 tags contain UTF16, UTF16BE and I really don't know of the best

[fpc-pascal] Darwin i386

2012-05-19 Thread Andrew Brunner
I'm having a hard time with GDB and debugging threads on a OSX 10.7.4 with fpc/trunk The shipped gdb worked great with the exception of threads calling methods via synchronize (so I can debug). I'm in the process of building GDB from download and configure set gdb to x64 darwin. Configure

Re: [fpc-pascal] Darwin i386

2012-05-20 Thread Andrew Brunner
What are you doing exactly, what happens, and what is the expected result instead? I'm upgrading my gdb from shipping version with darwin to gdb version from download. I downloaded and ran /configure make make install 7.1. It doesn't work with fpc. I'm going to have to switch back. The

Re: [fpc-pascal] Darwin i386

2012-05-20 Thread Andrew Brunner
On Sun, May 20, 2012 at 8:52 AM, Jonas Maebe jonas.ma...@elis.ugent.be The above was a question relating to ... with the exception of threads calling methods via synchronize (so I can debug). I.e., what are the exact things you are doing, what is happening, and what are the expected results

[fpc-pascal] Postgresql Concurrent Transactions

2012-06-21 Thread Andrew Brunner
Hi there, I'm seeking help to address an issue I presently have with a Server application that uses TPostgres components. Each manager thread has its own Connection, Transaction, and TQuery. Each manager can handle potentially thousands of sockets Each server instance (1 process) can have up to

[fpc-pascal] Problems with Postgresql Character Encoding

2012-09-26 Thread Andrew Brunner
for me when Connection is a postgresql connection. Anyone have any experience with postgresql character sets / encoding??? I can't hard-code any one character set because users from 1 region will have different encoding needs than another. Any help, or comments is greatly needed. -- Andrew

Re: [fpc-pascal] Problems with Postgresql Character Encoding

2012-09-26 Thread Andrew Brunner
/Lazarus and building now... -- Andrew Brunner Aurawin LLC 512.574.6298 http://aurawin.com/ Aurawin is a great new place to store, share, and enjoy your photos, videos, music and more. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http

Re: [fpc-pascal] Problems with Postgresql Character Encoding

2012-09-26 Thread Andrew Brunner
/view.php?id=22985 (I did only basic testing) -Laco. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal -- Andrew Brunner Aurawin LLC 512.574.6298 http://aurawin.com/ Aurawin is a great

[fpc-pascal] Subversion Client/Server Source

2012-10-24 Thread Andrew Brunner
contributions of SVN client/server code in pascal? Any help is greatly appreciated, Andrew Brunner Aurawin LLC 512.574.6298 A safe new way to store and share your files, pictures, videos, and more. http://aurawin.com/ ___ fpc-pascal maillist - fpc-pascal

Re: [fpc-pascal] Subversion Client/Server Source

2012-10-24 Thread Andrew Brunner
look at Apache svn source (C++) to port to Aurawin's HTTP server. But where is the Official svn documentation for implementing svn over http? -- Andrew Brunner Aurawin LLC 512.574.6298 A safe new way to store and share your files, pictures, videos, and more. http://aurawin.com

Re: [fpc-pascal] Subversion Client/Server Source

2012-10-24 Thread Andrew Brunner
. It looks like heavy XML. It will require use the fpc-xml. Are the DOM components proven to be memory leak free at this point? -- Andrew Brunner Aurawin LLC 512.574.6298 A safe new way to store and share your files, pictures, videos, and more. http://aurawin.com

[fpc-pascal] fcl-db components missing from 2.6.0 (Lazarus winx64 bin inst)

2012-10-29 Thread Andrew Brunner
system does find the unit when I hot-click the unit. I'm going to FPC/Laz build from svn/source but I just wanted to post here to see what was the cause... -- Andrew Brunner Aurawin LLC 512.574.6298 http://aurawin.com/ Aurawin is a great new way to store, share, and enjoy your photos, videos

Re: [fpc-pascal] Configuration file handling

2013-02-15 Thread Andrew Brunner
to update it simultaneously? In the case that I'm thinking of, I don't anticipate e.g. multiple logins trying to write setup information at the same time. The more risky case is if there are e.g. multiple daemons or apps trying to save state when a UPS signals imminent shutdown. -- Andrew

Re: [fpc-pascal] Re: Configuration file handling

2013-02-16 Thread Andrew Brunner
On Feb 16, 2013, at 2:37 AM, Reinier Olislagers reinierolislag...@gmail.com wrote: Security problems with world-writable files? Yes, that problem applies to *nix as well but Mark has given no indication his config files are world-writable. (Even if the logins Mark speaks of run under

[fpc-pascal] Performance problems with Image Conversions

2013-02-23 Thread Andrew Brunner
using the same methods. The speed is killing my server's performance. Does anyone have any idea how to speed up the underlining code? -- Andrew Brunner Aurawin LLC 15843 Garrison Circle Austin, TX 78717 https://aurawin.com Aurawin is a great new way to store, share, and explore all your content

Re: [fpc-pascal] Performance problems with Image Conversions

2013-02-24 Thread Andrew Brunner
On 02/24/2013 04:44 AM, Michael Van Canneyt wrote: Try to get rid of the XML, it is always going to be slow. Using XML can slow your applications with a factor 6. If you are mime-encoding an image, it'll be even more. I was just thinking about that. I think JSON would be ok, especially if

Re: [fpc-pascal] Performance problems with Image Conversions

2013-02-25 Thread Andrew Brunner
On 02/25/2013 04:51 AM, Graeme Geldenhuys wrote: ImageMagick will probably be a good choice. Regards, - Graeme - Ok, I'm going to start tests with that. Thanks ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org

Re: [fpc-pascal] Performance problems with Image Conversions

2013-02-25 Thread Andrew Brunner
; blob:=MagickGetImageBlob(wand,@bSize); Stream.Write(blob^,bSize); Result:=true; end; end; finally DestroyMagickWand(wand); end; end; -- Andrew Brunner Aurawin LLC 15843 Garrison Circle Austin, TX 78717 https://aurawin.com Aurawin is a great new way to store

Re: [fpc-pascal] Does FPC 2.8.0 can actually still be called Pascal ?

2013-02-27 Thread Andrew Brunner
into a bracket it ought-not-be. Jascal DOES look cool ;-) -- Andrew Brunner Aurawin LLC 15843 Garrison Circle Austin, TX 78717 https://aurawin.com Aurawin is a great new way to store, share, and explore all your content featuring our innovative cloud social computing platform

Re: [fpc-pascal] Does FPC 2.8.0 can actually still be called Pascal ?

2013-02-28 Thread Andrew Brunner
on the code contributor/creator. But to 1.) above, wrongly kowning up to bad code contributions is my largest genuine concern. -- Andrew Brunner Aurawin LLC 15843 Garrison Circle Austin, TX 78717 https://aurawin.com Aurawin is a great new way to store, share, and explore all your content

[fpc-pascal] Problems with ImageMagick Win64

2013-04-28 Thread Andrew Brunner
'; // Previous ImageMagick versions used 'libWand' {$endif} CORE_RL_magick_.dll CORE_RL_wand_.dll' Apon running the app, libMagickWand.dll was not found. Can someone please look into this? Thanks, -- Andrew Brunner Aurawin LLC 15843 Garrison Circle Austin, TX 78717 https://aurawin.com Aurawin

Re: [fpc-pascal] Problems with ImageMagick Win64

2013-04-28 Thread Andrew Brunner
On 04/28/2013 02:49 PM, Andrew Brunner wrote: I can't get ImageMagick unit to work under Windows XP 64. Also, I have confirmed that ImageMagick installed and the application does work. Can someone please edit change the unit code for Windows instead of Win32? The libraries are identical

Re: [fpc-pascal] Win64 release of FPC 2.6.2 missing

2013-05-04 Thread Andrew Brunner
. But the solution must conform to FPC standards with regards to builds/packaging. Thanks for any help in offering a 64bit download of FPC. Andrew Brunner, Aurawin LLC 512.574.6298 http://aurawin.com/ Aurawin is great new way to store and share your pictures, videos, and more, featuring our innovative

Re: [fpc-pascal] Problems with ImageMagick Win64

2013-05-04 Thread Andrew Brunner
http://bugs.freepascal.org/view.php?id=24346 Can someone please apply patch? Thanks. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Win64 release of FPC 2.6.2 missing

2013-05-06 Thread Andrew Brunner
I agree with what you are saying as long as the os matches the binary type. An x64 native package must install a x64bit binary and utils. I would be understating if I said that a 32bit binary would be normal on a 64bit distro. Andrew Brunner Aurawin LLC 512.574.6298 A safe new way

[fpc-pascal] ImageMagick and Static Linking

2013-05-08 Thread Andrew Brunner
Image Magick comes with static libraries and dynamic libraries. Is there any way to make ImageMagick unit support the *.lib files? I'm trying to avoid having to distribute the ImageMagick dlls. Thanks, -- Andrew Brunner Aurawin LLC 15843 Garrison Circle Austin, TX 78717 https://aurawin.com

[fpc-pascal] SQL Administration Component for MySQL, PostgreSQL, and Oracle

2009-07-20 Thread Andrew Brunner
of existing Delphi code. Components must be complete for Linux, MAC, Windows. Thanks, Andrew Brunner ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal

[fpc-pascal] Environment Variables with Include Directive

2009-07-26 Thread Andrew Brunner
I've got a situation where I'm wanting to concatenate a path from the environment with a string to specify the path to the actual file to include when building. PATH_TO_DATA_INCLUDES = '/mnt/Source/Includes/Data/ {$i %PATH_TO_DATA_INCLUDES%+definitions.inc} Is there any way to get FPC to join

[fpc-pascal] DB unit and Parameter Binding with Variants

2009-08-04 Thread Andrew Brunner
I am very pleased with the core features of the DB components and more specially the SQL components. Many thanks for your efforts. Development of these components for Linux, MAC, and Windows will make this platform more palatable. After reviewing the code for the TParams and TParam components,

Re: [fpc-pascal] DB unit and Parameter Binding with Variants

2009-08-04 Thread Andrew Brunner
Michael, If I extend the Param system to depend on the memory being allocated by the caller of the SetData and that the memory will be there for the duration of the SQL operation then all we need to do is have a pointer to the memory, the size of the memory, and the kind of memory. With these

Re: [fpc-pascal] Byte array manipulation

2009-08-16 Thread Andrew Brunner
Hi there, I have a ByteArray unit that's pretty extensive. function toString(Var Item:TByteArray):string var iLen:Integer; begin iLen:=System.Length(Item); SetLength(Result,iLen); if iLen0 then System.Move(Item[0],Result[1],iLen); end; On Sun, Aug 16, 2009 at 12:35 PM, Wimpie

[fpc-pascal] FIONREAD FPC FpIOCtl for Cross platform Sockets

2009-10-07 Thread Andrew Brunner
Sockets programming often requires a poll for how much data is available on a particular socket descriptor. I'm porting an inhouse library for a sockets implementation and I realize that while I have a FpIOCtl call in the baseUnix unit I have no such animal in the Sockets implement which would be

Re: [fpc-pascal] How to free this memory and avoid memory leak

2009-10-08 Thread Andrew Brunner
     Move(p, tocarray[0], SizeOf(tocarray)); This causes an Access Violation at runtime. This should not cause as RAV. You must call SetLength(toarray,SizeOfMemory) and also don't use SizeOf(tocarray) use Length(tocarray)*SizeOf(What ever the element is))

[fpc-pascal] QueueUserAPC Similar Cross platform Functionality

2009-10-08 Thread Andrew Brunner
Hi there, I've got a unit I'm porting from Windows to Linux and I came across a QueueUserAPC (Kernel32 Windows) I make to add a callback method that gets executed by the thread I added this to. function QueueUserAPC(Callback: Pointer; hThread: THandle; dwData:DWORD): boolean; stdcall; When the

[fpc-pascal] Re: QueueUserAPC Similar Cross platform Functionality

2009-10-09 Thread Andrew Brunner
but hey... my options are limited. If anyone has a better solution for Linux/Unix/Mac- I'm all ears. Thanks. On Thu, Oct 8, 2009 at 12:34 PM, Andrew Brunner andrew.t.brun...@gmail.com wrote: Does Threading under Linux have anything like this?  Have any of you done anything like this under *nix

Re: [fpc-pascal] QueueUserAPC Similar Cross platform Functionality

2009-10-09 Thread Andrew Brunner
...) Hope this helps... (or inspires you to think of something that will work :) ~David. On Thu 8 Oct 2009, Andrew Brunner wrote: Hi there, I've got a unit I'm porting from Windows to Linux and I came across a QueueUserAPC (Kernel32 Windows) I make to add a callback method that gets executed

Re: [fpc-pascal] Why use pointers to arrays?

2009-10-11 Thread Andrew Brunner
In general I use pointers to data structures and especially when they are arrays. Take the following PIntArray: ^TIntArray; TIntArray:Array of Integer; 1st benefit: declaring methods associated with classes before TIntArray needs to be defined or declared. eg. procedure DoSomething(Var

Re: [fpc-pascal] Why use pointers to arrays?

2009-10-12 Thread Andrew Brunner
On Sun, Oct 11, 2009 at 5:25 PM, Vinzent Höfler jellyfish.softw...@gmx.net wrote: Andrew Brunner andrew.t.brun...@gmail.com: 1st benefit: declaring methods associated with classes before TIntArray needs to be defined or declared.   eg. procedure DoSomething(Var Data:TIntArray); vs

Re: [fpc-pascal] Why use pointers to arrays?

2009-10-12 Thread Andrew Brunner
On Mon, Oct 12, 2009 at 12:43 PM, Marc Weustink m...@dommelstein.net wrote: Graeme Geldenhuys wrote: On 11/10/2009, Andrew Brunner andrew.t.brun...@gmail.com wrote:  FPC forces the ^ operator while accessing structures as pointers.  Delphi didn't force it and I even suspect that memory leaks

[fpc-pascal] Windows Seven and SVN source install

2009-11-07 Thread Andrew Brunner
Hi there, I just got a laptop that came with Windows Seven. I have complete automation scripts with my Ubuntu boxes but NONE of the commands to make FPC translate for me. I poured over wikis and blogs for info and even found the official (link below).

Re: [fpc-pascal] Windows Seven and SVN source install

2009-11-07 Thread Andrew Brunner
Yes. From any folder in command prompt I get fpc access. I just don't know the make commands and parameters. -Andy On Sat, Nov 7, 2009 at 7:31 AM, Vincent Snijders vsnijd...@vodafonevast.nl wrote: Andrew Brunner schreef: Hi there, I just got a laptop that came with Windows Seven.  I have

Re: [fpc-pascal] Windows Seven and SVN source install

2009-11-07 Thread Andrew Brunner
didn't get the source copied using make install sourceinstall PREFIX=MyPrefix On Sat, Nov 7, 2009 at 7:54 AM, Vincent Snijders vsnijd...@vodafonevast.nl wrote: Andrew Brunner schreef: Yes.  From any folder in command prompt I get fpc access.  I just don't know the make commands and parameters

Re: [fpc-pascal] Windows Seven and SVN source install

2009-11-07 Thread Andrew Brunner
C:\Developer\FPCmake install sourceinstall PREFIX=C:\FPC make -C win32 exampleinstall make[4]: Entering directory `C:/Developer/FPC/rtl/win32' make[4]: Nothing to be done for `exampleinstall'. make[4]: Leaving directory `C:/Developer/FPC/rtl/win32' make[3]: Leaving directory

Re: [fpc-pascal] Windows Seven and SVN source install

2009-11-07 Thread Andrew Brunner
On Sat, Nov 7, 2009 at 12:21 PM, Jonas Maebe jonas.ma...@elis.ugent.be wrote: You have to build/install an exported copy under Windows due to a bug in cp.exe there. First perform C:\Developer\FPC svn export . c:\Developer\FPCExport Then build/install from c:\Developer\FPCExport Well, if

Re: [fpc-pascal] dynamic array contents and system.move

2010-04-24 Thread Andrew Brunner
David, I don't see how you are not getting memory leaks by doing a move before making sure that the destination buffer has the memory allocated. You see, in Delphi and FPC, move d/n actually move the memory... It just copies it. You were warned :-) On Sat, Apr 24, 2010 at 3:01 PM, David

Re: Re[2]: [fpc-pascal] dynamic array contents and system.move

2010-05-05 Thread Andrew Brunner
Constants (values) or variable values (variables). Let's not forget assignable constants that must be typed :-) ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] methods of an object to create others objects

2010-07-06 Thread Andrew Brunner
obj1:=TMyObject.Create; Try  obj2:=TMyObject.Create;  Try    Obj1.DoSomething1;    Obj2.DoSomething2;   Finally     FreeAndNil(Obj2);   end;  Finally   FreeAndNil(Obj1); end; Hum... I do not agree. Why not this? See.. obj1:=TMyObject.Create; obj2:=TMyObject.Create; Try  

Re: [fpc-pascal] methods of an object to create others objects

2010-07-06 Thread Andrew Brunner
On Tue, Jul 6, 2010 at 10:31 AM, Marcos Douglas m...@delfire.net wrote: Better: obj1 := nil; obj2 := nil; Try  obj1 := TMyObject.Create;  obj2 := TMyObject.Create;  obj1.DoSomething1;  obj2.DoSomething2; finally  obj1.Free;  obj2.Free; end; The objectcs are protected. But is

Re: [fpc-pascal] methods of an object to create others objects

2010-07-06 Thread Andrew Brunner
On Tue, Jul 6, 2010 at 11:39 AM, Marco van de Voort mar...@stack.nl wrote: In our previous episode, Andrew Brunner said: obj1 := nil; obj2 := nil; Try ?obj1 := TMyObject.Create; ?obj2 := TMyObject.Create; ?obj1.DoSomething1; ?obj2.DoSomething2; finally ?obj1.Free; ?obj2.Free

Re: [fpc-pascal] methods of an object to create others objects

2010-07-06 Thread Andrew Brunner
On Tue, Jul 6, 2010 at 5:04 PM, Graeme Geldenhuys graemeg.li...@gmail.com wrote: I meant is as in it is safe to call MyObj.Free even if MyObj = nil. I answered based on the explicit question. But yes, in your example where MyObj was an instance, the code in the destructor could still trip

Re: [fpc-pascal] methods of an object to create others objects

2010-07-06 Thread Andrew Brunner
On Tue, Jul 6, 2010 at 5:09 PM, Graeme Geldenhuys graemeg.li...@gmail.com wrote: Even with a try..except, if you call MyObj.Free and it causes an exception, you are screwed either way and it will always cause a memory leak. Best is no notify the user some how, or crash out of the program, or

Re: [fpc-pascal] methods of an object to create others objects

2010-07-07 Thread Andrew Brunner
On Wed, Jul 7, 2010 at 2:09 AM, Graeme Geldenhuys graemeg.li...@gmail.com wrote: Op 2010-07-07 03:32, Martin het geskryf: And in the 2nd case, mem leaks are no worry = the app is going to be closed, mem will be freed by the OS. [...snip...] The whole memory management could be corrupted.

Re: [fpc-pascal] methods of an object to create others objects

2010-07-07 Thread Andrew Brunner
On Wed, Jul 7, 2010 at 8:05 AM, Martin f...@mfriebe.de wrote: if obj1.free; crashes, then yes obj2 is not going to be released. But as explained in this and my last mail: It should not be attempted to be released. Martin, I can't disagree more. I find it completely ludicrous that if

Re: [fpc-pascal] methods of an object to create others objects

2010-07-07 Thread Andrew Brunner
On Wed, Jul 7, 2010 at 8:37 AM, Graeme Geldenhuys graemeg.li...@gmail.com wrote:  procedure TObj1.Free; begin  Try    Disk1.Unmount;  Except    On E:Exception do begin       // Some case stuff here    end;  end;  Inherited Destroy; end; With the exception of a possible memory leak in

Re: [fpc-pascal] methods of an object to create others objects

2010-07-07 Thread Andrew Brunner
On Wed, Jul 7, 2010 at 8:34 AM, Martin f...@mfriebe.de wrote: Had you only read to the end of my mail. You are deliberately ignoring part of what I wrote and the blame me for the remainder being incomplete? I clearly stated that there are cases where free can raise a valid exception, and

Re: [fpc-pascal] methods of an object to create others objects

2010-07-07 Thread Andrew Brunner
Well... I think CGI gateway is a good way. If the real app (FCGI) have troubles, I can change the URL that the CGI (gateway) uses to call the real app and to point to another app (in other server, e.g.). What do you think about it? I think it would be worth discussing what can be done or at

Re: [fpc-pascal] lNet getting the local IP

2010-10-06 Thread Andrew Brunner
On Wed, Oct 6, 2010 at 7:55 AM, Sven Barth pascaldra...@googlemail.com wrote: You'll only find 127.0.0.1 for my computer there... I don't think that this is a very good solution. Oh well. That makes sense b/c these are servers that I have obtaining the same IP over DHCP. On clients when DHCP

Re: [fpc-pascal] Where is IsMultiThreaded set under Linux?

2010-10-08 Thread Andrew Brunner
procedure TBarThread.Execute; begin  FFinished := False;    // work-around variable  while not Terminated do  begin    Synchronize(@UpdateProgressBar);  end;  FFinished := True;     // work-around variable end; What about dropping that loop and put it in UpdateProgressBar

Re: [fpc-pascal] Where is IsMultiThreaded set under Linux?

2010-10-08 Thread Andrew Brunner
This seems like a discussion of semantics more than anything. In an application thread if you say WAITFOR something then the app cannot process messages b/c the execution is put on hold until WAITFOR returns. This is normal behaviour, IMO. So if this is just an exercise, I really don't see a

Re: [fpc-pascal] Where is IsMultiThreaded set under Linux?

2010-10-08 Thread Andrew Brunner
poll the Completes to see if they are all true. There are a million ways to accomplish safe thread usage without waitfor... On Fri, Oct 8, 2010 at 8:49 AM, Graeme Geldenhuys graemeg.li...@gmail.com wrote: On 8 October 2010 15:32, Andrew Brunner wrote: This seems like a discussion of semantics more

Re: [fpc-pascal] Where is IsMultiThreaded set under Linux?

2010-10-08 Thread Andrew Brunner
problems in the past with this does not mean I won't with a future. ;-) On Fri, Oct 8, 2010 at 9:04 AM, Jonas Maebe jonas.ma...@elis.ugent.be wrote: On 08 Oct 2010, at 15:57, Andrew Brunner wrote: A better way of achieving this is looking at the collection of threads you have.  Set your own

Re: [fpc-pascal] Where is IsMultiThreaded set under Linux?

2010-10-08 Thread Andrew Brunner
On Fri, Oct 8, 2010 at 9:21 AM, Jonas Maebe jonas.ma...@elis.ugent.be wrote: No, the main source of problems is that the cpu may reordering memory operations resulting in those booleans in the arrays becoming true before all memory locations written in the thread are visible. The result is that

Re: [fpc-pascal] Where is IsMultiThreaded set under Linux?

2010-10-08 Thread Andrew Brunner
On Fri, Oct 8, 2010 at 9:52 AM, Jonas Maebe jonas.ma...@elis.ugent.be wrote: So are you referring to the topic of this conversation regarding data flushing?  The notion of creating an index of completions to poll and waiting for all the values to turn true as a means to determine actual job

[fpc-pascal] Help getting Lazarus app in Ubuntu to elevate to root and back again

2010-10-08 Thread Andrew Brunner
I'm needing help to take my Lazarus app, elevate process to root (using GUI prompt like GKSU) and I want to drop back down to the user's level after port binding and listening. Ubuntu has port restrictions for low port numbers. I'm developing a platform that happens to use ports for HTTP, XMPP,

Re: [fpc-pascal] Where is IsMultiThreaded set under Linux?

2010-10-08 Thread Andrew Brunner
Right. But in the case of an array of booleans that will be polled and an exit condition will only be met if all booleans are set to true. The order in which a polling thread sees them as being true has no bearing on the functionality. On Fri, Oct 8, 2010 at 3:07 PM, Paulo Costa p...@fe.up.pt

Re: [fpc-pascal] Where is IsMultiThreaded set under Linux?

2010-10-08 Thread Andrew Brunner
On Fri, Oct 8, 2010 at 3:37 PM, Marco van de Voort mar...@stack.nl wrote: No, but the last one might be set before the condition coupled to that last one might be carried out. See Jonas' example. The ONLY way that could happen is if the boolean happens to be set in a worker thread's method that

Re: [fpc-pascal] Where is IsMultiThreaded set under Linux?

2010-10-08 Thread Andrew Brunner
, Oct 8, 2010 at 3:52 PM, Jonas Maebe jonas.ma...@elis.ugent.be wrote: On 08 Oct 2010, at 22:45, Andrew Brunner wrote: On Fri, Oct 8, 2010 at 3:37 PM, Marco van de Voort mar...@stack.nl wrote: No, but the last one might be set before the condition coupled to that last one might be carried out

Re: [fpc-pascal] Help getting Lazarus app in Ubuntu to elevate to root and back again

2010-10-11 Thread Andrew Brunner
On Sun, Oct 10, 2010 at 1:09 PM, Mark Morgan Lloyd markmll.fpc-pas...@telemetry.co.uk wrote: Could you suid it to root or to an appropriate group? I've not tried this for a Pascal/Lazarus program and don't know what the precise rules are for port usage (i.e. whether the user has to be root or

Re: [fpc-pascal] Multi-threaded project with few locks (no Thread.waitfor). Memory consumption keeps increasing on Ubuntu 10.10 x64

2010-10-13 Thread Andrew Brunner
13.10.2010 00:51, schrieb Andrew Brunner: This test case illustrates a FPC memory leak. What makes you think so? Internally freed memory is not immediatly released to the OS as well. On windows I know there is a call to flush all virtual memory out. Is there a wrapper in fpc for *nix and windows

[fpc-pascal] Re: Multi-threaded project with few locks (no Thread.waitfor). Memory consumption keeps increasing on Ubuntu 10.10 x64

2010-10-13 Thread Andrew Brunner
On Tue, Oct 12, 2010 at 5:51 PM, Andrew Brunner andrew.t.brun...@gmail.com wrote: Another problem demonstrated with this application is the limiting factor of thread creation. I'd like to make a complaint using this code as well. Change the number of threads to 3000. The system gets to about

Re: [fpc-pascal] Multi-threaded project with few locks (no Thread.waitfor). Memory consumption keeps increasing on Ubuntu 10.10 x64

2010-10-13 Thread Andrew Brunner
On Wed, Oct 13, 2010 at 8:27 AM, Jonas Maebe jonas.ma...@elis.ugent.be wrote: 1) on entry of the critical section protected by this variable, you can have problems, because this sequence: locked:=true; local:=shared_global_var; may actually be executed in this order:

Re: [fpc-pascal] Re: Multi-threaded project with few locks (no Thread.waitfor). Memory consumption keeps increasing on Ubuntu 10.10 x64

2010-10-13 Thread Andrew Brunner
On Wed, Oct 13, 2010 at 8:28 AM, Michael Van Canneyt mich...@freepascal.org wrote: Probably because it uses a heap manager per thread. You may try to use 'cmem', which will replace the heap manager with the C memory manager (one for the whole app, not per thread). That will allow you to test

Re: [fpc-pascal] Re: Multi-threaded project with few locks (no Thread.waitfor). Memory consumption keeps increasing on Ubuntu 10.10 x64

2010-10-13 Thread Andrew Brunner
On Wed, Oct 13, 2010 at 2:12 PM, Michael Van Canneyt mich...@freepascal.org wrote: FPC doesn't have anything to say about CPU allocation. The threads are created by the C pthread library and Linux kernel. They do the heavy work. Is it possible I have the pthread library in some sort of debug

[fpc-pascal] Building FPC with debug information

2010-10-13 Thread Andrew Brunner
I was reading on building FPC with debug enabled so I can trace into a unit and found that it was way too difficult to find the parameters. I know I had at one time edited the wiki page once I learned how to do it but to my surprise that info was either lost/moved or too hard to navigate and the

Re: [fpc-pascal] Re: Multi-threaded project with few locks (no Thread.waitfor). Memory consumption keeps increasing on Ubuntu 10.10 x64

2010-10-13 Thread Andrew Brunner
On Wed, Oct 13, 2010 at 3:24 PM, Michael Van Canneyt mich...@freepascal.org wrote: Is it possible I have the pthread library in some sort of debug mode that is slowing down the process of thread creation? I seriously doubt it. What you could do to test, is write your program using direct

Re: [fpc-pascal] Re: Multi-threaded project with few locks (no Thread.waitfor). Memory consumption keeps increasing on Ubuntu 10.10 x64

2010-10-14 Thread Andrew Brunner
On Thu, Oct 14, 2010 at 4:29 AM, Michael Van Canneyt mich...@freepascal.org wrote: Impressive. So the FPC implementation on top of this obviously does something on top of this which causes it to slow down. Possible culprits would then be the semaphores and TLS allocation. I obtained the

Re: [fpc-pascal] Building FPC with debug information

2010-10-14 Thread Andrew Brunner
Thanks, Jonas. On Thu, Oct 14, 2010 at 6:43 AM, Jonas Maebe jonas.ma...@elis.ugent.be wrote: On 14 Oct 2010, at 02:58, Andrew Brunner wrote: I was reading on building FPC with debug enabled so I can trace into a unit make OPT=-O- DEBUG=1 all Jonas

Re: [fpc-pascal] Re: Multi-threaded project with few locks (no Thread.waitfor). Memory consumption keeps increasing on Ubuntu 10.10 x64

2010-10-14 Thread Andrew Brunner
What are the exact differences from this test to your last one? Would be nice to know that... :) Every barrier causes a significant increase in time. In high performance parallel computing time is something we minimize. Big reductions in linear execution yield massive performance gains in the

Re: [fpc-pascal] What are the issues involved in threads sharing variables?

2010-10-15 Thread Andrew Brunner
On Fri, Oct 15, 2010 at 5:20 AM, Frank Church vfcli...@gmail.com wrote: I am writing an app involving 2 threads, and a timer loop in the UI. The first thread monitors network events, logs them into a database, appends them to a list. Any time I see append to a list I always think

Re: [fpc-pascal] Re: Multi-threaded project with few locks (no Thread.waitfor). Memory consumption keeps increasing on Ubuntu 10.10 x64

2010-10-15 Thread Andrew Brunner
On Fri, Oct 15, 2010 at 9:24 AM, Jonas Maebe jonas.ma...@elis.ugent.be wrote: You replaced a bunch of semaphore create/lock/unlock/destroy operations with calls to a function that does not do anything. I did not. I REMOVED create/destroy/lock/unlock. I ADDED calls to the ThreadManager's own

Re: [fpc-pascal] Re: Multi-threaded project with few locks (no Thread.waitfor). Memory consumption keeps increasing on Ubuntu 10.10 x64

2010-10-15 Thread Andrew Brunner
On Fri, Oct 15, 2010 at 9:24 AM, Michael Van Canneyt mich...@freepascal.org wrote: Thank you, I'll study it to see if/how we can do something to increase speed of creating threads in FPC. But if I understand you correctly, the WRITE_MEMORY_BARRIER() call is beyond our reach, so there's

Re: [fpc-pascal] Re: Multi-threaded project with few locks (no Thread.waitfor). Memory consumption keeps increasing on Ubuntu 10.10 x64

2010-10-15 Thread Andrew Brunner
On Fri, Oct 15, 2010 at 9:55 AM, Sven Barth pascaldra...@googlemail.com wrote: Am 15.10.2010 16:31, schrieb Andrew Brunner: On Fri, Oct 15, 2010 at 9:24 AM, Jonas Maebejonas.ma...@elis.ugent.be  wrote: You replaced a bunch of semaphore create/lock/unlock/destroy operations with calls

Re: [fpc-pascal] Re: Multi-threaded project with few locks (no Thread.waitfor). Memory consumption keeps increasing on Ubuntu 10.10 x64

2010-10-15 Thread Andrew Brunner
On Fri, Oct 15, 2010 at 10:06 AM, Jonas Maebe jonas.ma...@elis.ugent.be wrote: First of all, if you use tthread.create(true) (i.e., create a suspended thread), then the execute method will never be called: BTW: I did notice that the semaphore was being used to suspend the thread. And I also

Re: [fpc-pascal] Re: Multi-threaded project with few locks (no Thread.waitfor). Memory consumption keeps increasing on Ubuntu 10.10 x64

2010-10-15 Thread Andrew Brunner
On Fri, Oct 15, 2010 at 10:24 AM, Sven Barth pascaldra...@googlemail.com wrote: The problem isn't the pthreads library. The problem is the POSIX threading specification of which pthreads is an implementation (look at the comment in CSuspendThread again). POSIX is just like you say a

Re: [fpc-pascal] Re: Multi-threaded project with few locks (no Thread.waitfor). Memory consumption keeps increasing on Ubuntu 10.10 x64

2010-10-15 Thread Andrew Brunner
On Fri, Oct 15, 2010 at 10:57 AM, Vinzent Höfler jellyfish.softw...@gmx.net wrote: If you access it inside the execute method, you more or less crash (or at least leak memory). You obviously had a problem with access ThreadID before it was assigned. Accessing it should not arrive at a RAV.

Re: [fpc-pascal] Re: Multi-threaded project with few locks (no Thread.waitfor). Memory consumption keeps increasing on Ubuntu 10.10 x64

2010-10-15 Thread Andrew Brunner
On Fri, Oct 15, 2010 at 10:57 AM, Vinzent Höfler jellyfish.softw...@gmx.net wrote: Huh? Why should the pthreads library have a semaphore or similar on each thread? Good question. And according to pThreads source comments they themselves did unwillingly.

Re: [fpc-pascal] Re: Multi-threaded project with few locks (no Thread.waitfor). Memory consumption keeps increasing on Ubuntu 10.10 x64

2010-10-15 Thread Andrew Brunner
On Fri, Oct 15, 2010 at 11:03 AM, jellyfish.softw...@gmx.net wrote: On Fri, 15 Oct 2010 17:24:03 +0200, Sven Barth pascaldra...@googlemail.com wrote: The problem isn't the pthreads library. The problem is the POSIX threading specification of which pthreads is an implementation (look at the

Re: [fpc-pascal] Re: Multi-threaded project with few locks (no Thread.waitfor). Memory consumption keeps increasing on Ubuntu 10.10 x64

2010-10-15 Thread Andrew Brunner
On Fri, Oct 15, 2010 at 12:01 PM, Vinzent Höfler jellyfish.softw...@gmx.net wrote: Exactly.  It was poor implementation.  You should have had a global barrier onExecute.  That would unlock the thread after everything you needed was readable. If it's global, it would unlock *any* thread at

[fpc-pascal] FPC for High Performance Computing (HPC) Components with Application API

2010-10-15 Thread Andrew Brunner
I wanted to start a discussion based on current state of FPC and High Performance Computing (HPC). The premise of the thread is to discuss high scale threads. Currently FPC has matured to the point where it might be beneficial to start targeting a particular market for users. The first thing

Re: [fpc-pascal] FPC for High Performance Computing (HPC) Components with Application API

2010-10-15 Thread Andrew Brunner
: On 15 October 2010 21:24, Andrew Brunner andrew.t.brun...@gmail.com wrote: Suggested Reading:   http://ftp.gnu.org/gnu/glibc/glibc-linuxthreads-2.3.6.tar.gz Why would you want to look at this?  It's not used any more (except for really old kernels). Henry

Re: [fpc-pascal] Re: Multi-threaded project with few locks (no Thread.waitfor). Memory consumption keeps increasing on Ubuntu 10.10 x64

2010-10-16 Thread Andrew Brunner
On Sat, Oct 16, 2010 at 7:04 AM, Jonas Maebe jonas.ma...@elis.ugent.be wrote: He cannot. If freeonterminate=true, then even if you call inherited create(false) as the very last statement of your constructor, the thread may already have finished running and freed itself before AfterConstruction

Re: [fpc-pascal] FPC for High Performance Computing (HPC) Components with Application API

2010-10-16 Thread Andrew Brunner
On Fri, Oct 15, 2010 at 5:10 PM, Henry Vermaak henry.verm...@gmail.com wrote: I've told you before: NPTL is part of the glibc sources.  Download the latest glibc sources and look in the nptl directory.  The latest glibc release is 2.11.2. FPC source to cThreads unit and the thread manager

Re: [fpc-pascal] FPC for High Performance Computing (HPC) Components with Application API

2010-10-16 Thread Andrew Brunner
On Sat, Oct 16, 2010 at 2:16 PM, Henry Vermaak henry.verm...@gmail.com wrote: libpthread.so is the name of the library, not the name of the implementation. I updated FPC from SVN and it is pointing to this library now :-). Only problem is someone took some changes I made to remove semaphore on

  1   2   >