ssa.c: Initialize the Glib thread subsystem based on GLIB version

Signed-off-by: Sasha Kotchubievsky <sashakot@mellanox.com>
Signed-off-by: Hal Rosenstock <hal@mellanox.com>
ssa.c: Create Glib pthread pool for issuing rclose

rclose can take 30-90 seconds depending on certain parameters
and don't want to block upstream/downstream threads when rclose
is needed.

Signed-off-by: Sasha Kotchubievsky <sashakot@mellanox.com>
Signed-off-by: Hal Rosenstock <hal@mellanox.com>
ssa.c: Add logging before and after rclose in g_rclose_callback

Signed-off-by: Sasha Kotchubievsky <sashakot@mellanox.com>
Signed-off-by: Hal Rosenstock <hal@mellanox.com>
ssa.c: Push rclose to thread pool

Signed-off-by: Sasha Kotchubievsky <sashakot@mellanox.com>
Signed-off-by: Hal Rosenstock <hal@mellanox.com>
ssa.c: In ssa_cleanup, report number of rsockets waiting to be closed

Signed-off-by: Sasha Kotchubievsky <sashakot@mellanox.com>
Signed-off-by: Hal Rosenstock <hal@mellanox.com>
ssa.c: Call g_thread_init only if Glib ver < 2.32

From : https://developer.gnome.org/glib/stable/glib-Deprecated-Thread-APIs.html#g-thread-init

g_thread_init has been deprecated since version 2.32 and should
not be used in newly-written code. This function is no longer necessary.
The GLib threading system is automatically initialized
at the start of your program.

Signed-off-by: Sasha Kotchubievsky <sashakot@mellanox.com>
Signed-off-by: Hal Rosenstock <hal@mellanox.com>
ssa.c: Obtain number of available cores on the computer

 get_npproc function is used
 Number of cores is printed to log
ssa.c: Implement multithreaded PR computation.

 1. Current implementation is based on Glib's thread pool.
 2. Each PRDB calculation is a separate task
 3. Multithreaded calculation is used only during SMDB update
 4. Number of AL workers is number of available cores - 3.
    (upstream, downstream, access). It doesn't mean that
    that there is no context switch during PR computation.
    Also, probably, upstream, downstream, access are waiting
    for IO and doesn't spend actually CPU. The formula could
    be changed in future.
ssa.c: Store number of al workers in access context
ssa.c: Push a access task to thread pool only if number of workers > 1.

 Else, use access thread for the computation.
ssa.c: Fix GError usage