Search the Community
Showing results for tags 'delphi12'.
Found 4 results
-
Hello 🙂I have the following code in Delphi12, with slow functions PerformCalculations and SaveDataToDisk: function MutexBarrier(resource_mutex_id :String) :THandle; var Mutex :THandle; begin Mutex:=CreateMutex(nil,false,PChar(resource_mutex_id)); WaitForSingleObject(Mutex,INFINITE); result:=Mutex; end; procedure Main; //process main code (N processes are being run): var mutex :THandle; begin repeat mutex:=MutexBarrier('Mutex1_constant_unique_name'); try Prepare; finally ReleaseMutex(mutex); CloseHandle(mutex); end; PerformCalculations; mutex:=MutexBarrier('Mutex2_constant_unique_name'); try SaveDataToDisk; finally ReleaseMutex(mutex); CloseHandle(mutex); end; until False; end; I'm running N processes with this code, each on separate core (set with affinity, the number of cores > N). Processes do not create additional threads. Processes are run by a separate script like "proc.exe -core=x", where x is the expected affinity. Affinity is set correctly. But the effect of usage of mutexes is strange: 1. Initially all N processes quickly create queue on Mutex1, go through it one after another and then in parallel they are performing calculations on separate cores. 2. Then all N processes start to wait on Mutex2, and one of them (lets name it Process A) gets to the critical section of Mutex2. This is ok. 3. Then the process A which passed critical section of Mutex2 is going through Mutex1 and is performing calculations. At the same time all other processes still wait on Mutex1. - this is strange. 4. Only when process A finishes calculations and enters Mutex2 queue then some other process (name it process B) is entering the critical section of Mutex2. - This is very strange to me. 5. Then process B goes through Mutex1 and performs calculations., etc. In the effect, starting from point 3 only one process is performing calculations at a time. This is very strange to me. Why Mutex2 behaves like that. It is Win10. Remark 1: When SaveDataToDisk is fast (or not called at all - empty critical section of Mutex2), the problem is not happening - and all processes execute PerformCalculations in parallel. Remark 2: I have also verified that Prepare, PerformCalculations and SaveDataToDisk are not failing. I'm searching how to make Mutex2 to behave like expected, but no success till now. Maybe someone has some idea?
-
I have an app that uses SqLite on Android and iOS in encrypted mode. I'm migrating the app from Delphi 10.4 to Delphi 12.2. I get a link error I've never seen before : [DCC Error] E2597 C:\Users\Public\Documents\Embarcadero\Studio\23.0\CatalogRepository\AndroidNDK-21-23.0.53982.0329\android-ndk-r21\toolchains\arm-linux-androideabi-4.9\prebuilt\windows-x86_64\bin\arm-linux-androideabi-ld.exe: error: C:\\Program Files (x86)\\Embarcadero\\Studio\\23.0\\lib\\Android\\Release/libsqlite_fde.a(sqlite3_fde.o): multiple definition of 'sqlite3_aggregate_context' The file libsqlite_fde.a exists in all delphi directories "lib/android/debug" and "lib/android64/debug". I attach all error strings. If anyone has an idea on how to fix it I would be very happy. Thanks. logs.txt
-
HI, I created my media gallery using Delphi 10.4.2 and it works very well. I'm migrating to Delphi 12.2 and the Gallery is having some issues. The gallery reads, and if it does not exist, creates thumbnail files of the images present on the device from the \storage\emulated\0\pictures\.thumbnails\ directory. Using API 34 when I open the file in this directory I get an access denied exception. In manifest I have these permissions: <uses-permission android:name="android.permission.ACCESS_MEDIA_LOCATION" /> <uses-permission android:name="android.permission.MANAGE_MEDIA" /> <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" android:maxSdkVersion="32" /> <uses-permission android:name="android.permission.READ_MEDIA_AUDIO" /> <uses-permission android:name="android.permission.READ_MEDIA_IMAGES" /> <uses-permission android:name="android.permission.READ_MEDIA_VIDEO" /> <uses-permission android:name="android.permission.READ_MEDIA_VISUAL_USER_SELECTED" /> <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" android:maxSdkVersion="32" /> At runtime I check android.permission.READ_EXTERNAL_STORAGE and android.permission.WRITE_EXTERNAL_STORAGE. Now I use Nokia 2.2, Android 11 and Delphi 12.2.
-
Good day! When compiling an iOS application in Application Store mode, the following error occurs: " [PAClient Error] Error: E0776 2024-06-11 22:30:54.587 xcodebuild[1276:18656] [MT] IDEDistribution: -[IDEDistributionLogging _createLoggingBundleAtPath:]: Created bundle at path "/var/folders/g1/kgg6vjrx7q70pjsh4v66xtc80000gn/T/StepUp_2024-06-11_22-30-54.585.xcdistributionlogs". [PAClient Error] Error: E0776 2024-06-11 22:30:54.773 xcodebuild[1276:18656] [MT] IDEDistribution: Command line name "app-store" is deprecated. Use "app-store-connect" instead. [PAClient Error] Error: E0776 error: exportArchive: No "signingCertificate" specified. Provide the SHA-1 hash or name of the (null) certificate to use, or "(null)" to let Xcode choose one. [PAClient Error] Error: E0776 Error Domain=IDEDistributionSigningAssetStepErrorDomain Code=2 "No "signingCertificate" specified. Provide the SHA-1 hash or name of the (null) certificate to use, or "(null)" to let Xcode choose one." UserInfo={NSLocalizedDescription=No "signingCertificate" specified. Provide the SHA-1 hash or name of the (null) certificate to use, or "(null)" to let Xcode choose one.} " The application is signed: Development certificate: Apple Distribution (everything is fine with the signature in XCODE) Compiling an iOS application in Development mode (Development certificate: Apple Development) is successful The error occurs when the ipa file begins to be formed Saw a similar topic but the solution methods have probably changed, I was not able to use them. Are there any working methods to solve this problem?