This is the mail archive of the
newlib@sourceware.org
mailing list for the newlib project.
Problem of newlib running on the SMP platform.
- From: "Hao Shen" <william dot shen at gmail dot com>
- To: newlib at sourceware dot org
- Date: Thu, 11 Jan 2007 18:19:03 +0100
- Subject: Problem of newlib running on the SMP platform.
Hi, everybody,
I have found a problem about newlib running on the SMP platform.
First I describe my design environment here.
1. SMP platform shares the same memory and used the same memory address.
2. We have our SMP operating system which provide multi-thread and locks.
3. In the simulation, I found that the two threads in two different
CPUs enter the same system call at the same time. For example, both
threads call the "printf" and the output is terrible.
I have read some mails of newlib before. People suggest use
_impure_ptr and _reent. For my situation should I
1. Use two different _reent for two CPUs?
2. Use a different _reent for each thread?
3. Use only one _reent in whole system and lock it to guarantee only
one thread is using system call at the same time.
I am waiting for the answers.
Best regards,
Hao Shen