Login ProductsSalesSupportDownloadsAbout |
Home » Technical Support » Elevate Web Builder Technical Support » Support Forums » Elevate Web Builder General » View Thread |
Messages 1 to 5 of 5 total |
Using threads |
Mon, Jul 4 2016 6:33 AM | Permanent Link |
Ronald | Hi,
I want to start using the Elevate Web Builder Modules. In the manual you warn about thread-safe programming in these modules. I have read about thread safe programming and I understand that I shoud use threads. In your demo application "datasetmodule" I do not see any use of threads. Can you give me a general rule of thumb advice on when to use threads in a module? Greetings, Ronald |
Mon, Jul 4 2016 3:50 PM | Permanent Link |
Emin | Hi Ronald
<In your demo application "datasetmodule" I do not see any use of threads> Because the thread is managed (created/destroyed/pooled) within the EWB http server. TExampleDataSetModule is run within a context of this thread. So your code must be thread safe when using shared objects like database connections etc. <Can you give me a general rule of thumb advice on when to use threads in a module? > Unless you are going to start an asynchronous job etc. you don't need to create any additional threads in a module. Regards Emin Borbor |
Tue, Jul 5 2016 7:35 AM | Permanent Link |
Tim Young [Elevate Software] Elevate Software, Inc. timyoung@elevatesoft.com | |
Thu, Jul 7 2016 10:03 AM | Permanent Link |
Ronald | Thanks Emin and Tim,
But I still should not use global variables and I should take extra care when reading and writing to a .txt file on disk for example, I presume? Ronald |
Thu, Jul 7 2016 10:09 AM | Permanent Link |
Raul Team Elevate | On 7/7/2016 10:03 AM, Ronald wrote:
> But I still should not use global variables and I should take extra care when reading and writing to a .txt file on disk for example, I presume? In terms of accessing database (EDB/DBISAM) then you need to follow thread safe instructions for each. In terms of things like simple global variables (not EDB/DBISAM objects like sessions, tables, queries) if they are set one (say on startup) and then various threads simply read them then you're ok. If however the global variables are read and updated by one or more thread during runtime then you definitely need to use some sort of locking/syncronization method for access. Similar rules apply to file reading/writing Raul |
This web page was last updated on Wednesday, September 18, 2024 at 05:13 PM | Privacy PolicySite Map © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? E-mail us at info@elevatesoft.com |