March 7, 201016 yr Thanks for the offer but no thanks. If I were to seek tuition I'd find some one (a) whose answer to the question "Do you mean, for example, that if a process has 3 threads and Thread 1 is in a critical section and Thread 2 is suspended waiting for the critical section that Thread 3 has no access to the program's memory" isn't "In essence, correct. A critical lock will suspend other process threads until it's removed." and(:( who doesn't state the obvious - "I know what the EnterCriticalSection does and what can go seriously wrong if you don't release it." If you make an elementary programming error by not matching EnterCriticalSection() and LeaveCriticalSection() calls then, of course, things will go seriously wrong. Also Borland doesn't cheat. It provides a class TThread to facilitate using threads, in the same way as Visual C++ provides the class Thread. One of the properties of TThread is Handle which provides access to all WinAPI thread functions that require a handle. Gerry Howard
March 7, 201016 yr Commercial Member Thanks for the offer but no thanks. If I were to seek tuition I'd find some one (a) whose answer to the question "Do you mean, for example, that if a process has 3 threads and Thread 1 is in a critical section and Thread 2 is suspended waiting for the critical section that Thread 3 has no access to the program's memory" isn't "In essence, correct. A critical lock will suspend other process threads until it's removed." and(:( who doesn't state the obvious - "I know what the EnterCriticalSection does and what can go seriously wrong if you don't release it." If you make an elementary programming error by not matching EnterCriticalSection() and LeaveCriticalSection() calls then, of course, things will go seriously wrong. Also Borland doesn't cheat. It provides a class TThread to facilitate using threads, in the same way as Visual C++ provides the class Thread. One of the properties of TThread is Handle which provides access to all WinAPI thread functions that require a handle.A critical lock will suspend any thread that could have access to the same process memory space as the thread initiating the lock. Which, in this discussion, includes the main FS thread.Borland does cheat.... it's a good cheat, but it's a cheat. I have the source to all of Borland's classes... I've used their products for years as well as Microsoft's. Borland's TThread object is efficient and hides the 'terror' of threading... however, the way they actually implement the physical creation and execution of individual threads isn't the best approach and in fact does cheat. Ed Wilson Mindstar AviationMy Playland - I69
March 8, 201016 yr A critical cection does not "suspend any thread that could have access..." When a critical section object is owned, the only other threads affected are the threads that are waiting for ownership in a call to EnterCriticalSection. Threads that are not waiting are free to continue running.The Compact Oxford Dictionary defines cheat as 1 act dishonestly or unfairly in order to gain an advantage. 2 deprive of something by deceitful or unfair means. 3 avoid (something undesirable) by luck or skill: How is Borland being dishonest, unfair, or deceitful? Gerry Howard
March 8, 201016 yr Commercial Member A critical cection does not "suspend any thread that could have access..." When a critical section object is owned, the only other threads affected are the threads that are waiting for ownership in a call to EnterCriticalSection. Threads that are not waiting are free to continue running.If that were correct... then execute_calculator_code would never cause crashes... as it's simply a function address. However... your next statement (below) ends the conversation permanently. You're still a troll.The Compact Oxford Dictionary defines cheat as 1 act dishonestly or unfairly in order to gain an advantage. 2 deprive of something by deceitful or unfair means. 3 avoid (something undesirable) by luck or skill: How is Borland being dishonest, unfair, or deceitful?Clearly you're a troll and not a software developer of any calibre. Those who actually make a living writing software would understand clearly the term 'cheat' in regards to how someone writes code. I have never, ever used the ignore user feature in these forums... until just now. Ed Wilson Mindstar AviationMy Playland - I69
March 8, 201016 yr If that were correct... then execute_calculator_code would never cause crashes... as it's simply a function address. However... your next statement (below) ends the conversation permanently. You're still a troll.You may not see this but it's worth posting for the benefit of others.The sentences "When a critical section object is owned, the only other threads affected are the threads that are waiting for ownership in a call to EnterCriticalSection. Threads that are not waiting are free to continue running." which you say are not correct are from Microsoft: see the last sentence on the link below.http://msdn.microsoft.com/en-us/library/ms682530(VS.85).aspx Gerry Howard
Create an account or sign in to comment