|
Boost : |
Subject: Re: [boost] Is there any interest in a library for actor programming?
From: Oliver Kowalke (oliver.kowalke_at_[hidden])
Date: 2013-05-20 00:14:39
2013/5/20 Vicente J. Botet Escriba <vicente.botet_at_[hidden]>
> int main() {
>> auto worker = spawn(...);
>> // Um... what is the type of 'self'? Is it a valid receiver for the
>> response message?
>> send(worker, ...);
>> receive (
>> // again: what is 'self' allowed to receive/reply? ...
>> );
>> }
>>
> Couldn't spawn have a template parameter giving the provided protocol?
> Self could be typed with the supported protocol(s). Self could be passed
> by the underlying system as a parameter of the spawned function, as e.g.
> Boost.Coroutine does. This avoids the use of thread specific data to get
> the current self as I expect you do. Up to the user to manage with the self
> parameter.
>
This issue was discussed on the ISO C++ future proposals forum - using
thread specific data (thread_local,thread__) would not work if the worker
would migrate between the threads (compiler opts issue).
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk