What’s the use of _disable() and _enable()? I think the codes surrounded by _disable() and _enable() counld not be performed by more than once at the same time. But what’s the matter of the displays above?
Later, i sent SIGUSR1 signal to the main process, and it handled it, and DE_Function returned immediately! Can _disable() ignore all of signals?
Any kernel calls (which printf ends up doing) enable interrupts. Using _disable() is usually a very bad thing.
Think about it. If you were to disable interrupts, the kernel could not manage the timer require by the delay function. Furtheur more printf sends messages to Dev.* which couldn’t run if interrupts are disable since it also means disabling scheduling indirectly.
Don’t use tfork/exit for you thread use _beginthread and _endthread, look up the documentation for tfork it does mention it.
I have reached the conclusion that we have told this person enough times that he should not be using threads in QNX4. I, for one, have decided not to answer any more questions which so obviously stem from him continuing to use threads.
I did asked myself the same question. Is somebody asking from trouble worth helping. My conclusion so far is that as long as the “conversation” is enjoyable, that the person isn’t blaming everybody else for their own ignorance, and the person show some level of appreciation for the help given (for free) in here, then i’ll keep on helping.
I do think that Hmizly took on a challenge that is beyond his current capability. Yet I remember doing the same which to some degree has given me indepth knowledge of some of the inner working of QNX.
I REALLY REALLY REALLY know that it’s dangerous using threads in QNX4!
But i have to do that! All of projects of our company are all for QNX4 and i have to work with threads. I want to translate all of the codes into QNX6.x too, but there are more than 500 thousand line codes and only 3 programmers in our company!
So, i am so sorry to ask some questions refering to threads.
I have so few informations of QNX, and i have to ask lots of questions in openQnx forum.
Sure. Use multiple processes with messaging, unless you are bandwidth limited by messaging.
btw: threads in QNX4 can be thought of as separate processes with automatic data sharing, and if used in this way, there is absolutely nothing wrong with them (in fact this results in less code than manually setting up shared memory and placing data structures in it, etc., etc.).