Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] Very odd compiling problem
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Jonathan Roewen <jonathan.roewen@g...>
Subject: Re: [Caml-list] Very odd compiling problem
On 8/17/05, Jonathan Roewen <jonathan.roewen@gmail.com> wrote:
> Hi,
> 
> I'm having severe problems trying to compile my thread.ml file. I
> can't find anything odd in the syntax. The file is attached.
> 
> Error:
> File "thread.ml", line 34, characters 2-13:
> This expression is not a function, it cannot be applied
> 
> If I use lots of ;; the compile error goes away, but I don't understand why.

All problems listed above fixed .. needed let _ = ..., of all things >_<

The following is still a problem. As far as I can tell, the callback
value is still NULL. If I leave the if statement in, everything runs
fine (cept threading stuff doesn't get run). If I comment out the if
statements, I get a seg-fault....

> Also, in it's current state, the <Callback.register
> "caml_thread_schedule" schedule_thread> seems to be completely
> ineffective.
> 
> In C, I have:
> 
> CAMLprim value caml_thread_initialize(value unit)
> {
>        thread_current = caml_named_value("caml_thread_current");
>        thread_dequeue = caml_named_value("caml_thread_dequeue");
>        thread_enqueue = caml_named_value("caml_thread_enqueue");
>        thread_reschedule = caml_named_value("caml_thread_schedule");
>        return Val_unit;
> }
> 
> and
> 
> value caml_thread_yield(value requeue) {
>        save_thread_state();
>        value v = callback(*thread_dequeue, Val_unit);
> 
>        if (thread_reschedule != 0L ) {
>                callback2(*thread_reschedule, v, requeue);
>        }
>        ...
> }
> 
> The thread_dequeue call appears to work fine, but after much testing,
> I have found the thread_reschedule is NULL.
> 
> I'm using ocaml 3.08.2, if that helps at all. I'm completely blank as
> to what's going on, and my friend has no idea what's going on either.
> 
> Jonathan
> 
> 
>