Re: [Chicken-users] Threads, and async

2016-07-22 Thread Vasilij Schneidermann
Hello,

> About libuv, Chicken not very well suited for callback-based ffi, so there
> is no official available extensions, but integration is possible and working
> reasonable.

Do you have any material on doing FFI with callbacks?  I've had to solve
this problem before for GUI toolkits and settled for writing a generic
handler that did the dispatching to the actual procedure with a scheme
hash table, but I'd like to see small, self-contained examples on how
one could do better.

Cheers
Vasilij

___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] Threads, and async

2016-07-21 Thread rivo

Hi,

Chicken have special option like 'disable-interrupts' this one allow 
precise control over scheduler using thread-yield! function. As far i 
remember in order to get fully cooperative scheduling user should ensure 
that all code compiled with this option.


About libuv, Chicken not very well suited for callback-based ffi, so 
there is no official available extensions, but integration is possible 
and working reasonable.



On 21.07.2016 03:56, Josh Barrett wrote:
Firstly, are chicken's SRFI-18 "green threads" pre-emptive, or do you 
have to explicitly yield in order for the next scheduled thread to run?


Secondly, does Chicken have any libraries for libev/uv event-based 
programming?


Thirdly, are there chicken bindings for select/poll?

No, I don't intend to use these all at once, but they seemed related, 
so I figured I would write one big email instead of three small ones.


-Joshua Barrett


___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] Threads, and async

2016-07-21 Thread Christian Kellermann
* Josh Barrett  [160721 02:57]:
> Firstly, are chicken's SRFI-18 "green threads" pre-emptive, or do you have
> to explicitly yield in order for the next scheduled thread to run?

Yes they are preemptive.

> Secondly, does Chicken have any libraries for libev/uv event-based
> programming?

I am not aware of any.

> Thirdly, are there chicken bindings for select/poll?

There's the epoll egg, support for select/poll is part of the posix
unit. CHICKEN's scheduler itself is a poll loop basically.

http://api.call-cc.org/doc/posix#sec:file-select
http://api.call-cc.org/doc/epoll

> No, I don't intend to use these all at once, but they seemed related, so I
> figured I would write one big email instead of three small ones.

No worries!

HTH,

Christian

--
May you be peaceful, may you live in safety, may you be free from
suffering, and may you live with ease.

___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users