<?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[Is is possible to create a semaphore accessable to both Windows and Qt applications?]]></title><description><![CDATA[<p dir="auto">I tried to create a named semaphore in a Windows application using following code:</p>
<pre><code>m_hSemaphore = ::CreateSemaphore(NULL, 0, 100, "semaphore_test");
</code></pre>
<p dir="auto">and in my Qt application I open a semaphore of the same name:</p>
<pre><code>pSemaphore = new QSystemSemaphore(tr("semaphore_test"), 0, QSystemSemaphore::Open);
</code></pre>
<p dir="auto">But when the semaphore is released in Windows application, in Qt application,</p>
<pre><code>m_pSemaphore-&gt;acquire();
</code></pre>
<p dir="auto">is still blocked, which means two applications are not accessing the samesemaphore.</p>
<p dir="auto">Is there a way to make both applications access the same semaphore? The similar problem also exists in accessing shared memory in both Windows and Qt applications.</p>
]]></description><link>https://forum.qt.io/topic/20897/is-is-possible-to-create-a-semaphore-accessable-to-both-windows-and-qt-applications</link><generator>RSS for Node</generator><lastBuildDate>Wed, 22 Jul 2026 04:33:53 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/20897.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 25 Oct 2012 16:51:53 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Is is possible to create a semaphore accessable to both Windows and Qt applications? on Mon, 29 Oct 2012 15:12:50 GMT]]></title><description><![CDATA[<p dir="auto">I see, thanks! By the way, I just noticed that QSharedMemory::setNativeKey will set the native, platform specific key for this shared memory object, that will also help in Qt code to connect to shared memory created from Windows code.</p>
]]></description><link>https://forum.qt.io/post/155691</link><guid isPermaLink="true">https://forum.qt.io/post/155691</guid><dc:creator><![CDATA[cyao]]></dc:creator><pubDate>Mon, 29 Oct 2012 15:12:50 GMT</pubDate></item><item><title><![CDATA[Reply to Is is possible to create a semaphore accessable to both Windows and Qt applications? on Fri, 26 Oct 2012 22:18:48 GMT]]></title><description><![CDATA[<p dir="auto">I'm now at home and just check it. It does show up! But as a "section", not as a "file" ;-)</p>
<p dir="auto">Example:<br />
@\Sessions\1\BaseNamedObjects\qipc_sharedmemory_AAbbCFBFEEc953e91dc88f95245766d85214a816f620994f01@</p>
]]></description><link>https://forum.qt.io/post/155531</link><guid isPermaLink="true">https://forum.qt.io/post/155531</guid><dc:creator><![CDATA[MuldeR]]></dc:creator><pubDate>Fri, 26 Oct 2012 22:18:48 GMT</pubDate></item><item><title><![CDATA[Reply to Is is possible to create a semaphore accessable to both Windows and Qt applications? on Fri, 26 Oct 2012 17:55:39 GMT]]></title><description><![CDATA[<p dir="auto">No, it does not show up.</p>
]]></description><link>https://forum.qt.io/post/155521</link><guid isPermaLink="true">https://forum.qt.io/post/155521</guid><dc:creator><![CDATA[cyao]]></dc:creator><pubDate>Fri, 26 Oct 2012 17:55:39 GMT</pubDate></item><item><title><![CDATA[Reply to Is is possible to create a semaphore accessable to both Windows and Qt applications? on Fri, 26 Oct 2012 15:12:14 GMT]]></title><description><![CDATA[<p dir="auto">bq. Thank you very much for your help! Now I can make Windows application and Qt application use a same semaphore.<br />
ProcessExplorer does not show shared memory used by a process, so making Windows application and Qt application use same shared memory is still a problem. Any ideas?</p>
<p dir="auto">The "shared" memory is nothing but a "memory mapped file", one that is backed by the system page file rather than by a file system file. Doesn't it show up under the file handles in ProcessExplorer?</p>
]]></description><link>https://forum.qt.io/post/155508</link><guid isPermaLink="true">https://forum.qt.io/post/155508</guid><dc:creator><![CDATA[MuldeR]]></dc:creator><pubDate>Fri, 26 Oct 2012 15:12:14 GMT</pubDate></item><item><title><![CDATA[Reply to Is is possible to create a semaphore accessable to both Windows and Qt applications? on Thu, 25 Oct 2012 18:53:01 GMT]]></title><description><![CDATA[<p dir="auto">AFAIK Qt will decorate the Semaphore name, when using QSystemSemaphore().</p>
<p dir="auto">You can use a tool such as ProcessExplorer to lookup the actual (native) name of the Semaphore...</p>
<p dir="auto"><a href="http://technet.microsoft.com/de-de/sysinternals/bb896653.aspx" target="_blank" rel="noopener noreferrer nofollow ugc">http://technet.microsoft.com/de-de/sysinternals/bb896653.aspx</a></p>
<p dir="auto">!<a href="http://imageshack.us/a/img690/9056/clipboard01yi.png" target="_blank" rel="noopener noreferrer nofollow ugc">http://imageshack.us/a/img690/9056/clipboard01yi.png</a>(Screenshot from ProcessExplorer)!</p>
<p dir="auto">Looks like the string "qipc_systemsem_" followed by a hash of the specified string is used ;-)</p>
]]></description><link>https://forum.qt.io/post/155428</link><guid isPermaLink="true">https://forum.qt.io/post/155428</guid><dc:creator><![CDATA[MuldeR]]></dc:creator><pubDate>Thu, 25 Oct 2012 18:53:01 GMT</pubDate></item></channel></rss>