Hello,
I use uClinux-dist-20051014 for quite a while now and it worked great
so far.
Now I decided to activate md5sum utility in busybox. With this, I get
problems with pthreads. For some reason, only the first four
invocations of pthread_create() are successful. The fifth invocation
simply hangs. There's no error code returned, the system call simply
don't return. The main thread is still there, but it stops to do
anything. I have attached a file at the end of the mail and marked
the point of hang with comments to illustrate the problem.
When I unset the CONFIG_USER_BUSYBOX_MD5SUM, then everything starts
working properly again.
Any ideas what could be the cause of the problem or how to track down
the problem?
# include <ctype.h>
# include <errno.h>
# include <pthread.h>
# include <stdio.h>
# include "defs.h"
typedef struct {
pthread_t ser1; /*< Thread to handle data from serial 1 */
pthread_t ser2; /*< Thread to handle data from serial 2 */
pthread_t gsm; /*< Manage GSM library */
pthread_t alarm; /*< Alarm transmission */
pthread_t check; /*< Supelpro server */
pthread_t comm; /*< Sylcom client */
pthread_t serif; /*< Serial link */
pthread_t io; /*< Hardware control */
} task_info_t;
static task_info_t task_info; /**< Available tasks. */
# define START(what) \
if (pthread_create (&task_info.what, NULL, what##_main, &task_info))
{ \
fprintf(stderr, "%s\n", "thread " #what ": %s", strerror
(errno)); \
exit(EXIT_FAILURE); \
} else { \
fprintf(stderr, "%s\n", "thread " #what " started");
\
} \
# define JOIN(what) { \
pthread_join (task_info.what, NULL); \
fprintf (stderr, "%s\n", "thread " #what " joined"); \
}
int main (void)
{
START (io); /* io thread is started and is running properly */
START (gsm); /* gsm thread is started and is running properly */
START (ser1); /* ser1 thread is started and is running properly
*/
START (ser2); /* ser2 thread is started and is running properly
*/
/* I never get to this point, so none of the remaining threads runs
*/
START (alarm);
START (check);
START (comm);
START (serif);
JOIN (ser1);
JOIN (ser2);
JOIN (alarm);
JOIN (check);
JOIN (comm);
JOIN (serif);
JOIN (gsm);
JOIN (io);
exit (EXIT_SUCCESS);
}
_______________________________________________
uClinux-dev mailing list
[email protected]
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by [email protected]
To unsubscribe see:
http://mailman.uclinux.org/mailman/options/uclinux-dev