[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: bug: defining things in different threads
From: |
Ludovic Courtès |
Subject: |
Re: bug: defining things in different threads |
Date: |
Wed, 12 Nov 2008 14:03:41 +0100 |
User-agent: |
Gnus/5.11 (Gnus v5.11) Emacs/22.3 (gnu/linux) |
Hi Linas,
"Linas Vepstas" <address@hidden> writes:
> void * scm_one (void *p)
> {
> prtdbg("thread one");
> scm_c_eval_string ("(define x \"asddf\")\n");
> }
>
> void * scm_two (void *p)
> {
> prtdbg("thread two");
> scm_c_eval_string ("(display x)\n");
> }
AFAICS, there's not proper synchronization between these two threads
(e.g., a barrier), so it could be that thread 1 gets to define `x' after
thread 2 attempts to access it. Sure, there's a "sleep (1);", but a
barrier would make sure we're not seeing such a case.
Can you add proper synchronization and see if the problem is still here?
Thanks,
Ludo'.