www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - xcb error for core.thread's Thread.join

reply "Jeremy DeHaan" <dehaan.jeremiah gmail.com> writes:
Hey all,

I've never gotten any xcb errors with just regular D code before, 
but maybe I just haven't done anything that would have caused 
them.

I can't say I actually know much about how these things work, but 
does D not use xcb when it does threading on Linux?

I'm not really doing anything that I could call complicated. I am 
creating a secondary thread and just outputting some text to the 
console from both threads. The error itself seems to happen on a 
call to Thread.join, though I can't say why.
Dec 28 2014
parent reply "Jeremy DeHaan" <dehaan.jeremiah gmail.com> writes:
On Monday, 29 December 2014 at 06:26:04 UTC, Jeremy DeHaan wrote:
 Hey all,

 I've never gotten any xcb errors with just regular D code 
 before, but maybe I just haven't done anything that would have 
 caused them.

 I can't say I actually know much about how these things work, 
 but does D not use xcb when it does threading on Linux?

 I'm not really doing anything that I could call complicated. I 
 am creating a secondary thread and just outputting some text to 
 the console from both threads. The error itself seems to happen 
 on a call to Thread.join, though I can't say why.
Looks like it isn't the call to Thread.join, that was just a coincidence for my writeln debugging. If I have the second thread going it just happens.
Dec 28 2014
parent reply "Jeremy DeHaan" <dehaan.jeremiah gmail.com> writes:
On Monday, 29 December 2014 at 06:34:02 UTC, Jeremy DeHaan wrote:
 On Monday, 29 December 2014 at 06:26:04 UTC, Jeremy DeHaan 
 wrote:
 Hey all,

 I've never gotten any xcb errors with just regular D code 
 before, but maybe I just haven't done anything that would have 
 caused them.

 I can't say I actually know much about how these things work, 
 but does D not use xcb when it does threading on Linux?

 I'm not really doing anything that I could call complicated. I 
 am creating a secondary thread and just outputting some text 
 to the console from both threads. The error itself seems to 
 happen on a call to Thread.join, though I can't say why.
Looks like it isn't the call to Thread.join, that was just a coincidence for my writeln debugging. If I have the second thread going it just happens.
Not sure if this makes any difference, but I don't get any errors when I let the main thread sleep, but the main thread and secondary thread do not run simultaneously.
Dec 28 2014
parent reply Rikki Cattermole <alphaglosined gmail.com> writes:
On 29/12/2014 7:39 p.m., Jeremy DeHaan wrote:
 On Monday, 29 December 2014 at 06:34:02 UTC, Jeremy DeHaan wrote:
 On Monday, 29 December 2014 at 06:26:04 UTC, Jeremy DeHaan wrote:
 Hey all,

 I've never gotten any xcb errors with just regular D code before, but
 maybe I just haven't done anything that would have caused them.

 I can't say I actually know much about how these things work, but
 does D not use xcb when it does threading on Linux?

 I'm not really doing anything that I could call complicated. I am
 creating a secondary thread and just outputting some text to the
 console from both threads. The error itself seems to happen on a call
 to Thread.join, though I can't say why.
Looks like it isn't the call to Thread.join, that was just a coincidence for my writeln debugging. If I have the second thread going it just happens.
Not sure if this makes any difference, but I don't get any errors when I let the main thread sleep, but the main thread and secondary thread do not run simultaneously.
XCB and xlib in general is not thread safe. They should only ever be called on one thread. Although I'm guessing you're not directly interfacing with it in which case that little tidbit isn't much use to you.
Dec 28 2014
parent reply "Jeremy DeHaan" <dehaan.jeremiah gmail.com> writes:
On Monday, 29 December 2014 at 07:23:32 UTC, Rikki Cattermole 
wrote:
 On 29/12/2014 7:39 p.m., Jeremy DeHaan wrote:
 On Monday, 29 December 2014 at 06:34:02 UTC, Jeremy DeHaan 
 wrote:
 On Monday, 29 December 2014 at 06:26:04 UTC, Jeremy DeHaan 
 wrote:
 Hey all,

 I've never gotten any xcb errors with just regular D code 
 before, but
 maybe I just haven't done anything that would have caused 
 them.

 I can't say I actually know much about how these things 
 work, but
 does D not use xcb when it does threading on Linux?

 I'm not really doing anything that I could call complicated. 
 I am
 creating a secondary thread and just outputting some text to 
 the
 console from both threads. The error itself seems to happen 
 on a call
 to Thread.join, though I can't say why.
Looks like it isn't the call to Thread.join, that was just a coincidence for my writeln debugging. If I have the second thread going it just happens.
Not sure if this makes any difference, but I don't get any errors when I let the main thread sleep, but the main thread and secondary thread do not run simultaneously.
XCB and xlib in general is not thread safe. They should only ever be called on one thread. Although I'm guessing you're not directly interfacing with it in which case that little tidbit isn't much use to you.
But I thought that XCB was thread safe.
Dec 29 2014
parent Rikki Cattermole <alphaglosined gmail.com> writes:
On 29/12/2014 9:54 p.m., Jeremy DeHaan wrote:
 On Monday, 29 December 2014 at 07:23:32 UTC, Rikki Cattermole wrote:
 On 29/12/2014 7:39 p.m., Jeremy DeHaan wrote:
 On Monday, 29 December 2014 at 06:34:02 UTC, Jeremy DeHaan wrote:
 On Monday, 29 December 2014 at 06:26:04 UTC, Jeremy DeHaan wrote:
 Hey all,

 I've never gotten any xcb errors with just regular D code before, but
 maybe I just haven't done anything that would have caused them.

 I can't say I actually know much about how these things work, but
 does D not use xcb when it does threading on Linux?

 I'm not really doing anything that I could call complicated. I am
 creating a secondary thread and just outputting some text to the
 console from both threads. The error itself seems to happen on a call
 to Thread.join, though I can't say why.
Looks like it isn't the call to Thread.join, that was just a coincidence for my writeln debugging. If I have the second thread going it just happens.
Not sure if this makes any difference, but I don't get any errors when I let the main thread sleep, but the main thread and secondary thread do not run simultaneously.
XCB and xlib in general is not thread safe. They should only ever be called on one thread. Although I'm guessing you're not directly interfacing with it in which case that little tidbit isn't much use to you.
But I thought that XCB was thread safe.
It seems to support it, but there are manual calls you have to do. Which I can't really help with unfortunately. I just play by the old rule, if its low level os, its single threaded call. Makes going between OS api's so much easier.
Dec 29 2014