Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: Threads in Intraweb


This question is not answered. Helpful answers available: 2. Correct answers available: 1.


Permlink Replies: 5 - Last Post: Apr 5, 2018 1:14 PM Last Post By: Chad Hower Threads: [ Previous | Next ]
Arsene Mamert

Posts: 33
Registered: 12/21/01
Threads in Intraweb  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Apr 4, 2018 7:20 AM
Is it possible to access Intraweb TCriticalSection variable and use it with our own threads inside our application?
Chad Hower

Posts: 613
Registered: 3/2/07
Re: Threads in Intraweb  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Apr 4, 2018 7:37 AM   in response to: Arsene Mamert in response to: Arsene Mamert
On 4/4/2018 10:20 AM, Arsene Mamert wrote:
Is it possible to access Intraweb TCriticalSection variable and use
it with our own threads inside our application?

There is no need. CriticalSections are extremely light weight. Just
construct one and use it for your needs.
Arsene Mamert

Posts: 33
Registered: 12/21/01
Re: Threads in Intraweb  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Apr 4, 2018 10:41 AM   in response to: Chad Hower in response to: Chad Hower
Chad Hower wrote:
On 4/4/2018 10:20 AM, Arsene Mamert wrote:
Is it possible to access Intraweb TCriticalSection variable and use
it with our own threads inside our application?

There is no need. CriticalSections are extremely light weight. Just
construct one and use it for your needs.

I am already doing that.
The problem is that I cannot use IWUserSession elements, for example TClientDataSet, in my threads.
I am getting an access violation.
It is certainly because Intraweb is threaded and my threads are not synchronized with Intraweb ones.
This is why I want to be able to access Intraweb TCriticalSection
Chad Hower

Posts: 613
Registered: 3/2/07
Re: Threads in Intraweb  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Apr 5, 2018 7:01 AM   in response to: Arsene Mamert in response to: Arsene Mamert
On 4/4/2018 1:41 PM, Arsene Mamert wrote:
I am already doing that.
The problem is that I cannot use IWUserSession elements, for example TClientDataSet, in my threads.
I am getting an access violation.
It is certainly because Intraweb is threaded and my threads are not synchronized with Intraweb ones.
This is why I want to be able to access Intraweb TCriticalSection

You do not have a proper understanding of how threads function.

Per user session - there is only ever one thread active at a time to run
code for that user session. There is no need to lock access to things
that belong to that session.

If it is AVing, the problem is something other.
Arsene Mamert

Posts: 33
Registered: 12/21/01
Re: Threads in Intraweb  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Apr 5, 2018 10:22 AM   in response to: Chad Hower in response to: Chad Hower
Chad Hower wrote:
On 4/4/2018 1:41 PM, Arsene Mamert wrote:
I am already doing that.
The problem is that I cannot use IWUserSession elements, for example TClientDataSet, in my threads.
I am getting an access violation.
It is certainly because Intraweb is threaded and my threads are not synchronized with Intraweb ones.
This is why I want to be able to access Intraweb TCriticalSection

You do not have a proper understanding of how threads function.

Per user session - there is only ever one thread active at a time to run
code for that user session. There is no need to lock access to things
that belong to that session.

If it is AVing, the problem is something other.

If I don't have a proper understanding how thread work, how was I able to program 2 to 3 threads accessing VCL components and modifying them with no problems?
It is always the same problems with you people, when there is something wrong with your application, you start blaming the users.
So, I am asking you the question.
How is it that I cannot access IWUserSession elements in my threads without an access violation?
Chad Hower

Posts: 613
Registered: 3/2/07
Re: Threads in Intraweb  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Apr 5, 2018 1:14 PM   in response to: Arsene Mamert in response to: Arsene Mamert
On 4/5/2018 1:22 PM, Arsene Mamert wrote:
The problem is that I cannot use IWUserSession elements, for
example TClientDataSet, in my threads. I am getting an access
violation. It is certainly because Intraweb is threaded and my
threads are not synchronized with Intraweb ones. This is why I
want to be able to access Intraweb TCriticalSection

You do not have a proper understanding of how threads function.

Per user session - there is only ever one thread active at a time
to run code for that user session. There is no need to lock access
to things that belong to that session.

If it is AVing, the problem is something other.

If I don't have a proper understanding how thread work, how was I
able to program 2 to 3 threads accessing VCL components and modifying
them with no problems? It is always the same problems with you
people, when there is something wrong with your application, you
start blaming the users. So, I am asking you the question. How is it
that I cannot access IWUserSession elements in my threads without an
access violation?

Becoming defensive is not going to help.

Your message makes it very clear to me that you do NOT understand how
the threads work in IntraWeb or a server application in general. If you
insist that you do, then I doubt I can effectively assist you.

First of all, synchronize implies you are thinking about a main UI
thread - which does not exist in a server application nor IntraWeb. And
that is only one of the problems with your statement.

The Synchronize method cannot work in any fashion with IntraWeb. Not
only does it rely on a main UI thread, but it relies on Windows messages
which also cannot work in a server unless you plan on updating the SA
debug window.

"> start blaming the users. So, I am asking you the question. How is it
that I cannot access IWUserSession elements in my threads without an
access violation?"

You've not shown any code. Will you now imply that we are not being
helpful because we are left to guess about what code exists?

So do you want some assistance, or do you remain in the position that
you fully understand the problem?
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02