Home » U++ Library support » U++ MT-multithreading and servers » Multithread and INTERLOCK
Multithread and INTERLOCK [message #46327] |
Wed, 20 April 2016 22:40 |
mubeta
Messages: 77 Registered: October 2006
|
Member |
|
|
I want groped to better understand the operation of the multithread and the INTERLOCK statement.
The questions are more than one. I will try to condense and reduce them to the minimum necessary.
I'm working on an application that uses at least two threads. Maybe three. The inserted project.
The first surprise 'was the discovery that variables declared within functions associated with the thread will "lose" and changing the value as if they were destroyed and recreated. I solved this problem by declaring a global variables on the project, but I wanted to understand if this is correct. The various threads are not in continuous loop? (I have tried both using "Thread" and "CoWork" objects for verify how thwy works, with identical results).
The second question concerning the INTERLOCK statement. I understand the purpose and the use, but I can not handle the best thing to make fast code. It seems to me quite slowed the code with the use of INTERLOCK where they serve. How to handle these different interlocks?
The third problem that I see and I have not delved much, opting to ask you, is the the management of the logger files with "RLOG" macros, etc.
Using them in more threads will produce a mixed data in the same log file, and it is very difficult to read it. Using these macros it is possible to handling different log files and redirect the output to the correct one time by time?
|
|
|
Goto Forum:
Current Time: Fri May 09 15:39:31 CEST 2025
Total time taken to generate the page: 0.00725 seconds
|