Guillaume Yziquel a écrit :
It's a bit of a hack. The problem is, we have a C pointer to a stream and we want to give that to the MAL layer. So what happens is, a MAL command is constructed which looks something like in := "0x123456":streams; The string value "0x123456" is cast to a MAL streams type, and in doing so, the string is interpreted as a number and the numeric value is then used.
OK. So I understand now that this scheme allows to have two threads communicate with a pipe. The code is written in such a way that nothing is blocking, here. OK. But then, I wonder how things are done from the server side. I've been looking at the streams library, and I do not understand how the server, or rather the client thread, waits for input. I expect that it is not done through polling, but rather some kind of select statement. Therefore two questions: -1- How is the streams library supposed to be used when it comes to using select? -2- Where is the code which keeps the client thread waiting in a non-busy mode? All the best, -- Guillaume Yziquel http://yziquel.homelinux.org/