Re: [fpc-pascal] Case in Record
On Oct 8, 2009, at 9:12 AM, Jürgen Hestermann wrote: And I don't know any other Pascal Compiler who does any checks in this direction. Do some? I don't know, but ADA reportedly does. I don't know the differences to Pascal. Does it have the same syntax for variant records? FWIW, here is a link to the BNF of the Ada Programming Language: http://www.seas.gwu.edu/~adagroup/ada95-syntax/ Jerry Such a feature definitely seems useful to me. Of course it would be. But how should it work? Setting the tag variable when assigning a value and raising an error when reading with different variant? Then what if the tag variable is changed directly? Or should it be readonly (which would make sense IMHO). ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
[fpc-pascal] Is svn2.freepascal.org down?
I cant get in contact with the repository on svn2.freepascal.org (no ping reply either). Can someone give it a kick again... Kind regards, Torsten Bonde Christiansen. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Is svn2.freepascal.org down?
Torsten Bonde Christiansen schreef: I cant get in contact with the repository on svn2.freepascal.org (no ping reply either). The http server works, but the server does not reply to pings. Can someone give it a kick again... No need. Vincent ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
[fpc-pascal] Looking for remote working freelancer for a C++ to FPC porting project
Hello, We are a small company dedicated to data recovery software and are going to port over a mix of 18K C++ and some Delphi code to a cross platform (Mac+Win) data recovery tool. We are looking for a FreePascal programmer (student, freelancer, self-employed, etc.) that can assist our 2 developer team in this porting work. The C++ code needs to be translated 1:1, some Delphi code can be reused for this work. Place of work: whereever you can work Project: Porting over 18,000 C++ cross platform lines of code to FreePascal Time frame: from now until March 2010 Deadlines: no - you should have free time resources for at least 500-1000 lines per week Payment: based on negotiations If you think you are qualified or this might be an interesting project for you, please don't hesitate to contact me. I look forward to your contact. Mit freundlichen Grüßen/Best regards Alexander Grau Grau GbR Hardware & Software Solutions Eschenweg 12 32609 Huellhorst Germany www.grauonline.de Tel: +49 (0) 5741 2301259 Fax: +49 (0) 5741 235530 E-Mail: a...@grauonline.de ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
[fpc-pascal] Re: QueueUserAPC Similar Cross platform Functionality
After two days of research I've concluded that the best way to implement this for cross platform support is to go with a FiFo queue and have the individual threads transverse the list at a convenient point during the Execute method. It's gonna be CPU intensive compared to a Windows Kernel call 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 wrote: > Does Threading under Linux have anything like this? Have any of you > done anything like this under *nix? > > Thanks for any feedback. > ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] FIONREAD FPC FpIOCtl for Cross platform Sockets
Andrew Brunner wrote: Sockets programming often requires a poll for how much data is available on a particular socket descriptor. AFAIK, it doesn't? If data is available, but less than you request, a 'read' on the socket does not block, but returns the number of bytes read, which is less than you requested. Micha ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] QueueUserAPC Similar Cross platform Functionality
Hi Andrew, I don't really understand your question as well as I'd like to (in particular, I don't understand the difference between a "callback" and any other sort of procedure; as well as other confusions) So this might be bunk advice, but here it is... Have you considered making your own thread function wrapper that could duplicate the functionality you need? type thread_param_and_callback_func = record thread_func : function (p : pointer) : ptrint; // as required thread_param : pointer; // the parameter to the main thread func callback_proc : procedure (...); callback_param : ???; end; p_thread_param_and_callback_func = ^thread_param_and_callback_func; function thread_proc_wrapper (p : pointer) : ptrint; begin with thread_param_and_callback_func (p^) do begin thread_func (thread_param); callback_proc (callback_param); end; end; I've only made one multithreaded program at this point, but it was a huge success, and I used something similar to this-- a thread handling function that would repeatedly request tasks and execute them, until the tasks were all complete. (I added a repeat loop...) 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 by the thread I added this to. > > function QueueUserAPC(Callback: Pointer; hThread: THandle; > dwData:DWORD): boolean; stdcall; > > When the Thread gets around to it, it processes the callback function > I passed in during the queue call. > > Judging by the performance of this method I would say that the Windows > Kernel maintains a queue of events to process for each thread. And > this function allows me to attach a callback to that queue so I can > allocate memory within that stack rather than the stack of the calling > thread. This feature is important as I want to keep memory allocation > to specific threads. > > Does Threading under Linux have anything like this? Have any of you > done anything like this under *nix? > > Thanks for any feedback. > ___ > fpc-pascal maillist - fpc-pascal@lists.freepascal.org > http://lists.freepascal.org/mailman/listinfo/fpc-pascal > ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] QueueUserAPC Similar Cross platform Functionality
In theory that's what I'm planning to do to emulate the functionality. I'm going to create a queue using a FIFO technique and empty out the queue executing the callbacks for each item in the queue - from a manager thread. Thanks for the advice. -Andrew On Fri, Oct 9, 2009 at 11:40 AM, David Emerson wrote: > Hi Andrew, > > I don't really understand your question as well as I'd like to (in > particular, I don't understand the difference between a "callback" and > any other sort of procedure; as well as other confusions) So this might > be bunk advice, but here it is... > > Have you considered making your own thread function wrapper that could > duplicate the functionality you need? > > type > thread_param_and_callback_func = record > thread_func : function (p : pointer) : ptrint; // as required > thread_param : pointer; // the parameter to the main thread func > callback_proc : procedure (...); > callback_param : ???; > end; > p_thread_param_and_callback_func = ^thread_param_and_callback_func; > > function thread_proc_wrapper (p : pointer) : ptrint; > begin > with thread_param_and_callback_func (p^) do begin > thread_func (thread_param); > callback_proc (callback_param); > end; > end; > > I've only made one multithreaded program at this point, but it was a > huge success, and I used something similar to this-- a thread handling > function that would repeatedly request tasks and execute them, until > the tasks were all complete. (I added a repeat loop...) > > 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 by the thread I added this to. >> >> function QueueUserAPC(Callback: Pointer; hThread: THandle; >> dwData:DWORD): boolean; stdcall; >> >> When the Thread gets around to it, it processes the callback function >> I passed in during the queue call. >> >> Judging by the performance of this method I would say that the Windows >> Kernel maintains a queue of events to process for each thread. And >> this function allows me to attach a callback to that queue so I can >> allocate memory within that stack rather than the stack of the calling >> thread. This feature is important as I want to keep memory allocation >> to specific threads. >> >> Does Threading under Linux have anything like this? Have any of you >> done anything like this under *nix? >> >> Thanks for any feedback. >> ___ >> fpc-pascal maillist - fpc-pas...@lists.freepascal.org >> http://lists.freepascal.org/mailman/listinfo/fpc-pascal >> > > > > ___ > fpc-pascal maillist - fpc-pas...@lists.freepascal.org > http://lists.freepascal.org/mailman/listinfo/fpc-pascal > ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal