Jump to content

Kas Ob.

Members
  • Content Count

    461
  • Joined

  • Last visited

  • Days Won

    8

Everything posted by Kas Ob.

  1. Kas Ob.

    Try-Finally-end; & Exit??

    That i agree on, as i started to steer the topic away, and i am sorry. for integers, yes for integers and their family. ps : tested and known to fail to do so in Delphi's up to Seattle . I am in no place to ask this, so sorry too. but if you want to research and confirm it, then please, it might help the performance in few (thousands) places. Code to reproduce this piece of gem with optimization on of course, we need the best code, only the best function AddAB(A, B: Integer): Integer; begin Result := A + B; end; function AddBA(A, B: Integer): Integer; begin Result := B + A; end; procedure TForm10.FormCreate(Sender: TObject); begin AddAB(10, 5); AddBA(12, 8); end; And the assembly Again sorry @Stefan Glienke but that one of many that really boil my blood and it is almost everywhere.
  2. Kas Ob.

    Try-Finally-end; & Exit??

    @Stefan Glienke Please research this and report it. for integers, yes for integers and their family. ps : tested and known to fail to do so in Delphi's up to Seattle .
  3. Kas Ob.

    Try-Finally-end; & Exit??

    No, you are wrong here, sorry, we love Delphi and we love the Language and the IDE, but ( talking for myself)i don't trust Embarcadero to make it better, based on history and experience. No saying this is less than any other cases, but me to would love to see it better and better for each and every cases, the thing is the compiler in big part is still belong to early 90s from TP7, asking for this is like asking plastic car toys to build spaceship to go to space as they already understand something about motion. It is big, the compiler is so outdated, that will need huge adjustment to produce such code right, break and continue the current Delphi compiler know the breaking point before hand, with goto and the need to enter the finally and exit it without losing all the content of CPU register and variables, is again like the example above with plastic car toys, (used cars example because Uwe love those) @balabuev and don't get me wrong i agree 100% it is doable, but for me it is not priority. I would love if the Embarcadero Delphi compiler could generate good code for A+B like B+A, which IS NOT capable to do in 2023!
  4. Kas Ob.

    AcceptSecurityContext (Negotiate) not working

    Me too ! Going away from Google search, it is becoming useless more and more by the day. Setting up full test-environment is the highly recommended as i think and also as i remember it is pain in the back, to ask a specific or not very specific questions to someone who have no idea what you are looking for, also here kicks in the terminology to create bigger mess in communications. ps: I have close enough experience with domain problem, it was the need to remotely access hyper-v manager without domain and without RDP, found few sources and tried them all, all failed, i tried all combination with policies mentioned but no success, then there was a software and i can't remember its name, alas, searching the net also didn't help me recall, the trial version of it did allow me to control and manage the hyper-v services remotely without domain and without any special setup on my PC or on the server, my only regret now that i didn't dig deep into it and its traffic, all what it did need is user and password with server IP.
  5. Just to clear few things here, 1) All binaries that runs on Windows will go through some sort of security check, although it can be disabled or adjusted by policy editor or registry but it is not recommended. 2) All Signed files (binaries or not like cab or msi..) with certificates that have CRL (Certificate Revocation List) extension will and must be checked against the provided URL in that CRL, unless it is disabled by policy, this check happen with intervals defined and provided by the CRL server and the OS will remember to check again when you run or access that file, CRL extension is not the only one that cause such checking online but there is also the OCSP, and there is other extensions and services but less popular. 3) These checks and connections appears from the EXE but they are coming from OS DLL loaded forcibly by the OS into the memory. 4) If a file not signed it will not check for any certificates of course, but here will kick the installed security software if it is Windows Defender or else, every single one of them have an option/setting to send samples for unknown software (singed or not) to there servers for deep analysis, some of these are enabled by default, as mentioned above it could be Microsoft Defender that issuing such connections, yet and it is important find IPs to Akamai or Microsoft doesn't mean it is Windows service, it could be an 3rd party software that using Azure or Akamai CDN .... 5) almost every application will crash on these sandboxes in VirusTotal, and as these Sandboxes with Windows on default settings or may be aggressive security settings, will generate WER report and will try to send it to Microsoft, hence these extra connections. So back to regedit.exe, it is signed and that sandbox most likely will revert to its default with each run, and each time will try to update its Root or at least the CA store, on other hand regedit have GUI and most likely will crash too and generate a report and use the WER, as evidently reported.
  6. Kas Ob.

    ANN: sgcWebSockets Rad Studio 12

    I played with these beautiful demos, watched them on WireShark and the whole package is very very impressive. congratulations ! Suggestions : 1) The only thing is missing here is WebDav ( http://www.webdav.org/specs/ ), RFC 4918 namely, the other extensions could be added later, it will add out of the box support for many Cloud Storage like DropBox. 2) The lack of OpenSSL from Standard and Professional Editions is quite a deal, rendering the selection of these editions a lot less favorable, and almost useless for mobile devices. 3) The price of Basic in comparison with Full Source also makes little sense (at least to me) as the Basic is half price but with half period of support/update and without the source, you might consider make the Full with source available for half period, instead of the Basic, just suggestion, i know it is not my place, but sounding my opinion.
  7. Kas Ob.

    Try-Finally-end; & Exit??

    Right, but lets see exactly what is going under the hood Exit, will not care about any variables and will clean them for the whole procedure. Break and Continue the compiler have a clear view of what should keep what not, GoTo, will make a mess and hide some dangerous behavior and i doubt Delphi compiler will be able to handle it, even it did, the use cases is near zero. Away from that there is critical differences between try..except and try..finally, with except there is a trap for exception, the finally..end block will only be executed on an exception, that known, but what about the generated code, the compiler will not give a rat ass about any logic inside that block or after it, it is your problem (the programmer), with finally..end the block must be executed every time even when an exception is raised, here the compiler is responsible to greater degree with the logic flow, again with goto inside try..finally i think the compiler can be made to handle it, but as i prefer : if it can't be build to do it right, then don't start with it or don't accept such code.
  8. Kas Ob.

    Try-Finally-end; & Exit??

    Well, try..finally block inside the try..finally..end will construct special frame to be handled only by its finally..end block, hence goto L1 will not be simple as what it should do, and it must become : goto L1 -> finnaly...end block -> label L1: though it is doable and the compiler simply does not implement it.
  9. Kas Ob.

    AcceptSecurityContext (Negotiate) not working

    Sorry for guessing as i can't debug or test any better than you. To me that look like enforced policy or missing domain for the user, Windows has strict policy when it comes to domains and users already known in AD. Will definitely give you the reason and the ability to resolve this, but you must duplicate the same configuration for registered domain and their policy ? that is the tricky part, as to my knowledge these are scattered over few services and there is no one resource to explain them all.
  10. Kas Ob.

    Changes in the C++ Builder 12.0 editor

    Look at the bright side, Embarcadero Mail server is working, which is nice.
  11. Kas Ob.

    Delphi 11 & 12 LZMA Compression

    Your obj files are compiled with VS C RTL, aka Microsoft Visual C++ Run Time, remove that dependency then rebuild it, and you will get rid of that error.
  12. The UDP one is most likely secured DNS connection, the others are some shitty AV/Security software you have installed, check its settings and you will find that you are allowing to send samples from your PC, and that shit is literally sending everything to its server, every single new EXE that is not in their DB. And please share with us the name of this great tool.
  13. Well, many many things and questions went into my head after seeing your snippets code. Why are you complicating things ? 1) As one you can just create a new and initialize it then replace it without locking at all, that is possible because your thread are running without explicit control like just use this one, so create new one and replace it, simple like that. 2) From your first post, i got the idea that the create and reload will be one time and one time only, but it seems you will create it once and reload many times. 3) in "TFHIROperationFactory.GetOperation" there is no comment showing were the result is filled . 4) in that same function your log saying "Waiting for Operations to be loaded" while it should say "try to load or wait" 5) You are accessing some IO operation i think, deducing that from the name "Settings.ReadInteger", most likely some IniFile, File, DB operation... irrelevant per se, but why doing it from locked section, halting all your threads, such operation can be done by one background thread on interval that satisfy your application need, again this valid operation and valid point due the way your threads are running, because from what i see you are letting the threads handling what every there, in different situation, all the threads are waiting on signal to start processing, but here you are just changing lanes for them, so reading the settings and apply with touching or blocking threads is valid point. 6) I don't like the following at all What the point of it if "TFHIROperationFactory.GetOperation" is using the same TMonitor.Enter(Self) ?!! These are the obvious points but i see few others, anyway,,, Don't complicate things for your self when it is absolutely not needed, redesign that in very simple way, your threads are consuming whatever they are fed, great and perfect for lock-free design, create and initialize another (temp) then perform all the operation you need like load and reload, then just swap it, to be on safe side you can use atomic operation to signal for you self that this line is thread critical line, now for the old, free it when its ref count is 0, if you are using refCounted Interfaces then this should happen automatically for you, if not then just add RefCount field for it, lets consumer threads add and dec it, then make sure the code will check if this is new and there is an old, (here the temp mentioned above will be not temp but temp field), if it has assigned value there this means the thread that will reach 0 by decreasing and the value is not null will signal a timer or a back ground thread to free it after some time. Hope that helps.
  14. My aim was the most readable code for OP to make sure he get the idea and enhance on it as he see fit.
  15. Remove all an be done in few ways, the easiest and simplest one is to centralize the access to that object and don't access it directly, use a getter, that getter can be function in singleton or global one, or just a property with getter, this getter will have CriticalSection instead of TMonitor, i just hate TMonitor, it is up to you after all, both will do fine. In that getter the locked section will active only if the field or the object is assigned meaning it will not cause locking once it is created, but if it is not yet assigned, the lock will be holding all threads except one, the creator, once it created and assigned the new callers will not enter locked section, and the waiting ones will be released, but the first check in the locked section will be to see if the object is assigned and created then exit. Just make sure the creating of that object doesn't fail or wait indefinitely. Something like this , more or less function TForm10.GetMyObject: TMyObject; var TempMyObject: TMyObject; begin Result := FMyObject; if Assigned(Result) then Exit; FCriticalSection.Enter; try Result := FMyObject; if Assigned(Result) then Exit; // Create MyObject in TempMyObject , DON'T CREATE FMyObject directly FMyObject := TempMyObject; Result := FMyObject; finally FCriticalSection.Release; end; end;
  16. Thank you ! I am in Ukraine and using the biggest ISP here, but didn't notice and didn't expect changing the language will change prices without changing the items listing themselves (names and prices).
  17. Clicking from here https://fgx-native.com/ru/buy.html also redirect this link to the English one https://forum.fgx-native.com/store/product/1-подписка-на-3-месяца-только-для-рф-и-снг/
  18. Clicked on that link, here what i see One year for CIS is higher than the rest of the world with the discount.
  19. Kas Ob.

    Delphi 12 is available

    GTX SpeedStar F1, code name "Dawn", will make great name. As for the patches, numbers are something from different millennia, better something like AfterDawn or Breakfast, BroLaunch, "MorningCoffee The First of its Name"...
  20. I can't reach a page with such prices from Ukraine ?
  21. Hard to tell, it depends on many things and the context around it. May be, again no way to tell. I suggest to prefer the readability always, when the efficiency is needed only then you have to test and benchmark different code/algorithms/approaches... , you can profile the code and make sure that there is wasted speed, or even better is to look at the generated assembly, but this is not everyone cup of tea.
  22. @Stefan Glienke Right on point there. I want to add one thing about inc/dec vs add/sub 1, they are not faster nor slower, but there is side effect which might sometimes yield a difference and speed boost, the effect is from the competition between two CPU enhancement Out-of-Order-Execution and Speculative Execution, older CPUs have OoOE mostly and little of SE, through generations CPUs are depending on SE more as it enhance and gain more than OoOE, the thing is both share in part (or all i have no idea) of the OoOE window, which is a buffer that handle the Re-Order buffer ROB also, while SE has an extra window/buffer to handle all branches/variations of executions, here these branches are not only branching form jumps only but from calculations, like adc the result might be two variants and that depend on the carry C flag, and this is the real difference, while as you know inc/dec change C flag, add/sub 1 will not, the difference is inc/dec will save bytes to fit in OoOE to execute more instruction, while SE will branching the whole block of following instruction due the change of C flag, thus shorten its overall can-be-executed. This effect can be witness if C flag is used in a loop to detect or checked, also can be observed when the loop is bigger than the OoOE window, on my SandyBridge that window size is 168 byte, and SE is not playing any role, on more modern CPU that windows is more than 224 bytes, i couldn't find a table or a list of comparison for many CPUs, but observed this on big loops running on modern XEONs, against the test on my SandyBridge where the loop is big more than ~180 byte of instructions and add/sub where faster by ~%5, and on mine add/sub was slower by ~%1.
  23. Kas Ob.

    Memory leak with anonymous methods.

    No leak on XE8 and Seattle.
  24. Kas Ob.

    Shell Controls: losts... and found!

    I have to point that they are not installed by default for good reason, so i recommend to install them only on project bases instead of keep them installed and laoded on the IDE. These components will bring huge overhead from Windows GUI shell, background threads, hooks, etc... they will affect the IDE stability and responsiveness and bring Windows Defender hooks in your IDE, so nice to have them on specific projects but not all the time loaded with the IDE, you can install them and disable them from loading and enable them only when needed in a project.
  25. Here is a better example than the above, you can see the implementation in full.
×