Jump to content

Vincent Gsell

Members
  • Content Count

    6
  • Joined

  • Last visited

Community Reputation

0 Neutral

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Vincent Gsell

    Python code is running in main thread (on standard) ?

    Hello Pi4D is great! (Here is a "just in time" webinar ;)) IMHO, the use of threads is not straightforward with python. (in python alone, it's already not great, that said ;)) there are demos with thread management in the Pi4D subdirectories. Please, study it : for your issue, it will help. That said, here is my experience in python threading scenarios applied in production: - Use only 1 pythonEngine. - Simple Thread: Use the provided TPythonThread class. If we use only 1 thread so as not to "block the GUI" (as you seem to want to do), it works fine. Be careful, if you want to use the IO components, you *must not* set PythonEngine.ThreadMode to newInterpreter. - NewInterpreter disables IO (see PythonExecute) - In all case, An "AllowThreading" directive must be called before and after using thread. (see demo) - In multithreading (more than 2 threads), it is imperative to set PythonEngine.ThreadMode to newInterpreter (at least, according to my unit tests). --> Consequence: no more IO. We have to manage differently via the scripts - In Massif mutlithread : Under linux, as part of a cloud server running python services, I use Python by running a command line run and getting the standard output. This saves resources but we no longer have the advantages of handling scripts via P4D at all. So I adapt my scripts. Hope this helps!
  2. Hi ! On my side, I have 2 pro use case (delphi and FPC) where we changed standart memory manager : First, I'm fully agreed with David Hefferman, we have not succeded to spot "the" memory manager which spot all our need. -> I proclamed myself "basic user" on this subject, I plug, and launch test, and I took the best thanks memory/speed/context meters. :) - First case , where we used FastMM4 in a customized bus oriented server : (GridServer + custom synapse based socketing) work very well. (used preliminary for memory counsumption barrier) - Second case, in a raytracer-like image generator, where we targeted best thread usage with memory sharing : We are using currently scalemm2 on backend intel based server (and nothing on arm embeded based - (side question : is there some memory manager perform well on linux/arm under FPC ?). On the first use case, on FastMM4/FastMM5 usage, I have a slight better result on FastMM5. I'll dig :) On the second one, Test results give to ScaleMM2 to keep its avantage (Average of 35% more speed than FastMM5 - again, no tunning) Note that, this result is the same with FastMM4) @Pierre le Riche If you are interested to get some test code for this "graphics" test, I'll be happy to cooperate. Here it is, in all case *thank you a lot* Pierre, for your *amazing work* (and @Günther Schoch's company for sponsoring !): FastMM5 is cool and work well as is, no more really need to tune compile side, (this is cool), and the overall compatibility seems to be nice. regards, Vincent
  3. But if you ever contact the author, is it not better to ask a dll which wrap directly the data acqusition mecanism ? (if it is a cpp solution...) In fact, I had done such things, in order to get Panda3D "PBR" offscreen rendering image, and got pretty good result with sending data via UDP by 64k chunk, (App "from" was Python).
  4. Vincent Gsell

    DIBControls by Droopy Eyes Software

    Was very good comps ! I remember cDib.pas was excelent. :) Kudos Mr Morris :) Funny things is I tryed to recompile it for fun a couple of month ago, and it compile with only a few compilations directive and pchar ajustement under 10.3.2, but there are some unicode stuff needs to be upgrade under the tree :) So, It compiles, Install, but do not works :) I saw there are some animation compo that I did not see on 2K's times : I missed something. :) When working on PXL compos wrapper, I always had in mind DIBControl, how it was fast and smooth !
  5. Joining Lars's solution : Queue are cool, and the polling solution offer many avantage compare to syncho stuff, as you mention it. I usually stand on a Bus for intercommunication thread in case of dedicated taks thread resident and "service" oriented, as you describte. https://github.com/VincentGsell/GS.Bus
  6. Vincent Gsell

    Playing multiple wave files simultaneously

    Hi, Playing dynamicaly sounds on parallel channel is not easy : You have to deal with low level media implementation. I used BASS (https://www.un4seen.com/) for a kiosk app demo : it is free for non commercial use : Delphi exemple are provided and mixing are perfect : It is the lightweightest solution that I known for excelent quality. IT match delphi (Win) and FPC for Win, Nix, and OsX. As suggested by David, Mitov's AudioLab is, AFAIK, free for non cormercial use too, and match more target (FMX one) but I do not try it.
×