<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[QThread stack-address]]></title><description><![CDATA[<p dir="auto">Greetings,</p>
<p dir="auto">I use Qt4.8 on Windows and I´m searching a way of getting the stack-address of a QThread or<br />
set the stack myself.</p>
<p dir="auto">With pthreads it´s possible to get/set the stack-pointer by pthread_attr_getstack() and<br />
pthread_attr_setstack().<br />
Since QThreads are built upon pthreads there should be a solution but I only found<br />
QThread::setStackSize and I don´t like the idea of running a pthread in my QtApp only<br />
because of getting the address.</p>
<p dir="auto">The reason I need this is preventing the garbagecollection of my embedded interpreter<br />
which lives in a QThread from running amok ( <a href="http://bugs.ruby-lang.org/issues/2294" target="_blank" rel="noopener noreferrer nofollow ugc">http://bugs.ruby-lang.org/issues/2294</a> )</p>
<p dir="auto">I would be really thankful for getting some help/advice (also if it´s just telling me that it´s not possible -.-)</p>
]]></description><link>https://forum.qt.io/topic/21421/qthread-stack-address</link><generator>RSS for Node</generator><lastBuildDate>Wed, 16 Sep 2026 18:25:06 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/21421.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 14 Nov 2012 21:05:40 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to QThread stack-address on Fri, 16 Nov 2012 09:30:00 GMT]]></title><description><![CDATA[<p dir="auto">Helps a lot. Thank you very much for explaining rcari.</p>
]]></description><link>https://forum.qt.io/post/157181</link><guid isPermaLink="true">https://forum.qt.io/post/157181</guid><dc:creator><![CDATA[[[global:former-user]]]]></dc:creator><pubDate>Fri, 16 Nov 2012 09:30:00 GMT</pubDate></item><item><title><![CDATA[Reply to QThread stack-address on Thu, 15 Nov 2012 13:20:48 GMT]]></title><description><![CDATA[<p dir="auto">Well it is based on pthread on UNIX systems but on native Windows threads on Windows. Qt is a cross-platform API and provides access to what can be used in a cross-platform way. The address of the stack must therefore not be portable, otherwise it would be part of the API.<br />
QThread was not really intended to be subclassed with @QThread::run()@ overloaded and used to fire up custom threads anyway. The initial design goal was to create a secondary event-loop in which QObjects could live and handle signals/events without blocking the main GUI thread. @QObject::moveToThread()@ is used for just that.<br />
So for your specific platform-related need, I think you'll have to go the platform-specific way and create your own pthread/native thread and use the platform API to achieve what you want.<br />
Hope this helps!</p>
]]></description><link>https://forum.qt.io/post/157111</link><guid isPermaLink="true">https://forum.qt.io/post/157111</guid><dc:creator><![CDATA[[[global:former-user]]]]></dc:creator><pubDate>Thu, 15 Nov 2012 13:20:48 GMT</pubDate></item></channel></rss>