Re: [Interest] Default stack size of QThread

2023-08-31 Thread Ramakanth Kesireddy
Thanks for your feedback.
The latter statement is correct as we are trying to solve the problem due
to lack of understanding.

Best Regards,
Ramakanth


On Wed, 30 Aug, 2023, 01:25 Thiago Macieira, 
wrote:

> On Monday, 28 August 2023 23:34:26 PDT Ramakanth Kesireddy wrote:
> > Thanks for your feedback.
> > As we donot set any stack size for QThread and it looks like it runs out
> of
> > default stack size limit during long running operation. Hence would like
> to
> > measure the cumulative stack variables used in a thread so as to set
> stack
> > size of QThread accordingly.
>
> That's not how stacks work: long-running has nothing to do with the size
> of
> the stack. What matters for stack depth is just that: how deeply do you
> recurse.
>
> So I repeat the question: why do you think you need to change anything? Do
> you
> have a concrete problem?
>
> Because if you don't, it looks like you're trying to solve a problem that
> doesn't exist out of a misunderstanding of how things work.
>
> --
> Thiago Macieira - thiago.macieira (AT) intel.com
>   Cloud Software Architect - Intel DCAI Cloud Engineering
> ___
> Interest mailing list
> Interest@qt-project.org
> https://lists.qt-project.org/listinfo/interest
>
___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] Default stack size of QThread

2023-08-29 Thread Thiago Macieira
On Monday, 28 August 2023 23:34:26 PDT Ramakanth Kesireddy wrote:
> Thanks for your feedback.
> As we donot set any stack size for QThread and it looks like it runs out of
> default stack size limit during long running operation. Hence would like to
> measure the cumulative stack variables used in a thread so as to set stack
> size of QThread accordingly.

That's not how stacks work: long-running has nothing to do with the size of 
the stack. What matters for stack depth is just that: how deeply do you 
recurse.

So I repeat the question: why do you think you need to change anything? Do you 
have a concrete problem?

Because if you don't, it looks like you're trying to solve a problem that 
doesn't exist out of a misunderstanding of how things work.

-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Cloud Software Architect - Intel DCAI Cloud Engineering


smime.p7s
Description: S/MIME cryptographic signature
___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] Default stack size of QThread

2023-08-29 Thread Ulf Hermann via Interest
As we donot set any stack size for QThread and it looks like it runs out 
of default stack size limit during long running operation. Hence would 
like to measure the cumulative stack variables used in a thread so as to 
set stack size of QThread accordingly.


It is possible to measure stack usage, but there is no fun in it. If 
you're willing to use private QtQml API you can call stackProperties() 
as declared in [1] to find an approximation of the stack boundaries. You 
can then compare that with currentStackPointer(), conveniently defined 
in the same file, to get your stack usage.


Mind that it's not really exact. See [2] for the implementation.

[1] 
https://code.qt.io/cgit/qt/qtdeclarative.git/tree/src/qml/memory/qv4stacklimits_p.h


[2] 
https://code.qt.io/cgit/qt/qtdeclarative.git/tree/src/qml/memory/qv4stacklimits.cpp


best regards,
Ulf Hermann
___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] Default stack size of QThread

2023-08-29 Thread Ramakanth Kesireddy
Thanks for your feedback.
As we donot set any stack size for QThread and it looks like it runs out of
default stack size limit during long running operation. Hence would like to
measure the cumulative stack variables used in a thread so as to set stack
size of QThread accordingly.



On Mon, 28 Aug, 2023, 22:37 Thiago Macieira, 
wrote:

> On Monday, 28 August 2023 05:08:25 PDT Ramakanth Kesireddy wrote:
> > Hi,
> >
> > We are using Qt 5.15.x through yocto Dunfell on embedded Linux.
> >
> > Any thoughts on default stack thread size of QThread would be great if it
> > would be 1-2MB.
>
> Why do you want that? This either indicates you don't understand how
> memory
> management works on Linux or you have a different problem that needs
> fixing.
>
> If you really want this, then QThread doesn't enforce any limit. Please
> consult the documentation for the pthread_create() function on how how it
> determines the default stack size. For glibc, it uses the RLIMIT_STACK
> resource limit.
>
> --
> Thiago Macieira - thiago.macieira (AT) intel.com
>   Cloud Software Architect - Intel DCAI Cloud Engineering
> ___
> Interest mailing list
> Interest@qt-project.org
> https://lists.qt-project.org/listinfo/interest
>
___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] Default stack size of QThread

2023-08-28 Thread Thiago Macieira
On Monday, 28 August 2023 10:05:14 PDT Thiago Macieira wrote:
> If you really want this, then QThread doesn't enforce any limit. Please
> consult the documentation for the pthread_create() function on how how it
> determines the default stack size. For glibc, it uses the RLIMIT_STACK
> resource limit.

I meant, "by default". Yes you can change the stack size using 
QThread::setStackSize(), but the default of QThread is 0, so it's whatever the 
underlying implementation chooses.

Since you're using Yocto, if this really matters to you, just change the 
underlying implementation or Qt. But please answer the question on why you 
think you need this.

-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Cloud Software Architect - Intel DCAI Cloud Engineering


smime.p7s
Description: S/MIME cryptographic signature
___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] Default stack size of QThread

2023-08-28 Thread Thiago Macieira
On Monday, 28 August 2023 05:08:25 PDT Ramakanth Kesireddy wrote:
> Hi,
> 
> We are using Qt 5.15.x through yocto Dunfell on embedded Linux.
> 
> Any thoughts on default stack thread size of QThread would be great if it
> would be 1-2MB.

Why do you want that? This either indicates you don't understand how memory 
management works on Linux or you have a different problem that needs fixing.

If you really want this, then QThread doesn't enforce any limit. Please 
consult the documentation for the pthread_create() function on how how it 
determines the default stack size. For glibc, it uses the RLIMIT_STACK 
resource limit.

-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Cloud Software Architect - Intel DCAI Cloud Engineering


smime.p7s
Description: S/MIME cryptographic signature
___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


[Interest] Default stack size of QThread

2023-08-28 Thread Ramakanth Kesireddy
Hi,

We are using Qt 5.15.x through yocto Dunfell on embedded Linux.

Any thoughts on default stack thread size of QThread would be great if it
would be 1-2MB.

Best Regards,
Ramakanth
___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest