Commit Graph

11 Commits

Author SHA1 Message Date
Avi Kivity
58487b55d4 smp: massage init captures to satisfy clang 2014-11-26 14:59:03 +02:00
Tomasz Grabiec
b647bb5746 smp: introduce distributed::start_single()
Services which create UDP sockets on the same port on POSIX stack can
have only one instance. This decision needs to be made at run-time.
2014-11-11 13:52:23 +02:00
Tomasz Grabiec
618cbd5729 smp: introduce foreign_ptr<>
A smart pointer wrapper which deletes the pointer on the CPU on which
it was wrapped.
2014-11-11 13:52:23 +02:00
Tomasz Grabiec
a77ecbeeef smp: introduce distributed::invoke_on_all() overload for void-returning functions 2014-11-11 13:52:23 +02:00
Tomasz Grabiec
c71f762f59 smp: introduce distributed::local() 2014-11-11 13:52:23 +02:00
Tomasz Grabiec
79982a8545 smp: add distributed::invoke_on() overload for void-returning functions 2014-11-11 13:52:23 +02:00
Tomasz Grabiec
8bbe285004 smp: improve forwarding of arguments in distributed::invoke_on()
It is now capable of moving r-values rather than copying them.
2014-11-11 13:52:23 +02:00
Tomasz Grabiec
1988748885 smp: introduce distributed::map_reduce() 2014-11-11 13:52:23 +02:00
Tomasz Grabiec
6611160db1 smp: fix distributed::stop()
One problem was that 'inst' was const, another was that the vector was
not cleared which made ~distributed() to complain.
2014-11-09 16:47:16 +02:00
Tomasz Grabiec
48d57a6cd9 core: make distributed::start() capable of forwarding references 2014-11-09 16:34:14 +02:00
Avi Kivity
e7ce27ea32 smp: add distributed<>, infrastructure for distributed service
Summary:

  distributed<my_service> dist;

  dist.start() - constructs my_service on all cpus
  dist.stop() - destroys previously constructed instances
  dist.invoke(cpu, &my_service::method, args...) - run method on one cpu
  dist.invoke_on_all(cpu, &my_service::method, args...) - run method on all cpus
2014-10-26 13:34:31 +02:00