[Bf-committers] Console patch update and question about Mac usage

Joe Eagar joeedh at gmail.com
Wed Aug 30 02:36:50 CEST 2006


Jean-Luc Peurière wrote:
>
> Le 29 août 06 à 23:27, Stephane SOPPERA a écrit :
>
>> Branan Riley a écrit :
>>> Allqueue gets used everywhere,
>> Ok, but as far as I know it's called only in the main thread since 
>> except for the render engine, blender works in a single thread.
>> That's why I'm asking if it's safe for calling from another thread 
>> than the main one. I don't think so since there are no mutex on the 
>> blender events queue.
>>> We need Ton to answer these questions, I think. I'm not very well
>>> versed in the depths of Blender's structure.
>> You're right, that is certainly the person that can answer this 
>> question.
>>
>
> I will look at the patch too.
>
> Now i agree the -c option should enable the redirection, not the other 
> way around on systems with a real console.
>
> I personally redirect the system console on my desktop, so i can see 
> output from all applications at once, so i'm not keen
> with someone or something else messing with that.
>
> quick look at the patch (will do more later) :
>
> there is 1870 +/- lines of JMS hotkeys reference script, that dont 
> belong here
>
> Thread safety must be insured. More, any openGL call or function that 
> call one can be
> only done in the main thread, i think (no guarantee of valid context 
> in GHOST).
>
> why unbuffering stderr ?
>
> from man : The standard error stream stderr is always unbuffered.
>
> for stdout, wont it be safer to unbuffer only the output of the pipe ?
>
>
> From a general point of view, having 2 secondary threads (and 4 fd 
> open in 2 pipes)  just for reading the error messages,
> seems to me more than a bit overkill.
>
> What we need to read here ?
>
> - messages from python.
> - printf or cout message in the main code.
>
> For the latter, it should be easy to set-up something like 
> GEN_messaging (used in GE C++), as those messages are
> all defined by the coder, simply open 1 or 2 new fd for all messages.
>
> For the former, cant we intercept messages before they are sent to 
> output ? Being not a pythoner, i have not the answer,
> but that i would find cleaner.
>
> As Nathan pointed out, not linking against console subsystem will 
> eliminate the dosbox on windows, so the matter is only
> to intercept messages properly.
You can actually write a python script to redirect python's stdout/err 
to a scripts window.  So doing it in C should be easy :)

Joe


More information about the Bf-committers mailing list