On Centos7, install libaio
dependency:
# yum -y install libaio
Download precompiled Compressed TAR Archive Mysql Community Server for generic linux.
using Base.Test | |
@enum ECompoundingType EContinuous=1 ESimple=2 EExponential=3 | |
abstract TCompoundType | |
type TContinuous <: TCompoundType end | |
type TSimple <: TCompoundType end | |
type TExponential <: TCompoundType end |
Build environment:
Build script was (see https://github.com/felipenoris/mongo-c-driver-builder/blob/fn/vs2017/appveyor.yml):
tar xf mongo-c-driver-1.14.0.tar.gz
cd mongo-c-driver-1.14.0
using Distributed | |
function machines_vector(user::String, ips::Vector{String}, ports::Vector{I}) where {I<:Integer} | |
machines = Vector() | |
for ip in ips, port in ports | |
push!(machines, "$user@$ip 0.0.0.0:$port") | |
end | |
return machines |
# nice | |
ccall(:setpriority, Cint, (Cint, Cint, Cint), 0, 0, 3)` to decrease priority by 3 |
Step 52/69 : RUN git clone https://www.github.com/coin-or/coinbrew && cd coinbrew && ./coinbrew fetch --no-prompt SYMPHONY:stable/$SYMPHONY_VER && ./coinbrew build --no-prompt SYMPHONY --prefix=/usr/local --parallel-jobs="$(nproc --all)" && ./coinbrew install SYMPHONY && cd .. && rm -rf coinbrew | |
---> Running in a15a898a2043 | |
Cloning into 'coinbrew'... | |
warning: redirecting to https://github.com/coin-or/coinbrew.git/ | |
Welcome to the COIN-OR fetch and build utility | |
For help, run script with --help. | |
################################################## |
# implements `run_notify_action(listener, val=nothing)` | |
abstract type AbstractEventListener end | |
# makes `listener` listen to notify events on `condition` | |
function add_listener(condition::Threads.Condition, listener::AbstractEventListener) | |
Threads.@spawn begin | |
lock(condition) | |
try | |
while true |
function create_heavy_work_tasks(parallel_jobs::Integer, secs::Integer) :: Vector{Task} | |
jobs = Vector{Task}() | |
for i in 1:parallel_jobs | |
push!(jobs, create_single_heavy_work_task(secs)) | |
end | |
return jobs |
O uso de Threads.@threads
deve ser evitado.
Esta macro utiliza um scheduler estático que não funciona muito bem quando temos uma chamada à macro Threads.@threads
a partir de uma função que já está rodando em modo multithread.
Só é seguro utilizar esta macro em código top-level quando há garantia de que não há outras tasks executando em modo multithread e para funções que não disparam código em modo multithread.