64 Commits

Author SHA1 Message Date
Johan Wikman
a8b42d24b7 Handle fake events when they are delivered
Since fake events are delivered via the event loop they can and
indeed should be processed immediately.
2017-04-20 13:51:16 +03:00
Johan Wikman
21ac606ee1 poll_[add|remove]_fd_[from|to]_worker made boolean 2017-04-20 13:51:16 +03:00
Johan Wikman
72eadff181 Further remove use of the worker C-API 2017-04-20 13:51:16 +03:00
Johan Wikman
64ab48f698 Sorting out rebase 2017-04-20 13:51:16 +03:00
Johan Wikman
86b7eb622e DCBs now added/removed without locks
This is not globally safe yet, but all other access is directly or
indirectly related to maxadmin, which is irrelevant as far as
performance testing is concerned.
2017-04-20 13:51:16 +03:00
Johan Wikman
6c3c96cb7e Inject hangup event in owning thread
When a hangup event needs to be inserted into all DCBs referring
to a particular server, it is done in the worker thread that owns
the DCB.
2017-04-20 13:51:16 +03:00
Johan Wikman
56c132f273 Move poll_[add|remove]_dcb to dcb.c 2017-04-20 13:51:16 +03:00
Johan Wikman
85faca74f7 Move DCB specific event handling to dcb.c 2017-04-20 13:51:16 +03:00
Johan Wikman
63141bb191 WIP: Allow the adding of any fds to the poll set
This is just a first step in a trial that will allow the addition
of any file descriptor to the general poll mechanism and hence
allow any i/o to be handled by the worker threads.

There is a structure

  typedef struct mxs_poll_data
  {
      void (*handler)(struct mxs_poll_data *data, int wid, uint32_t events);
      struct
      {
          int id;
      } thread;
  } MXS_POLL_DATA;

that any other structure (e.g. a DCB) encapsulating a file descriptor must
have as its first member (a C++ struct could basically derive from it).

That structure contains two members; 'handler' and 'thread.id'. Handler is a
pointer to a function taking a pointer to a struct mxs_poll_data, a worker thread
if and an epoll event mask as argument.

So, DCB is modified to have MXS_POLL_DATA as its first member and 'handler'
is initialized with a function that *knows* the passed MXS_POLL_DATA can
be downcast to a DCB.

process_pollq no longer exists, but is now called process_pollq_dcb. The
general stuff related to statistics etc. will be moved to poll_waitevents
itself after which the whole function is moved to dcb.c. At that point,
the handler pointer will be set in dcb_alloc().

Effectively poll.[h|c] will provide a generic mechanism for listening on
whatever descriptors and the dcb stuff will be part of dcb.[h|c].
2017-04-20 13:51:16 +03:00
Markus Mäkelä
ad1c05b015 Merge branch '2.1' into develop 2017-04-05 11:35:13 +03:00
Markus Mäkelä
5c1c89c835 Remove unused buffer types
A part of the buffer types weren't used or provided no real functionality.
2017-03-31 14:12:02 +03:00
MassimilianoPinto
8e24f847e6 Fix compile errors in Centos 6
Fix compile errors in Centos 6
2017-03-27 09:49:21 +02:00
Johan Wikman
e3bae59e1a Fix C++ issues in debug mode 2017-03-24 12:54:52 +02:00
Johan Wikman
db18e19d3c Compile dcb.c as C++ 2017-03-24 09:21:20 +02:00