view release on metacpan or search on metacpan
lib/Analizo/Batch/Runner/Parallel.pm view on Meta::CPAN
waitpid($pid, 0);
}
}
sub coordinate_workers {
my ($self, $batch, $output) = @_;
my $context = ZMQ::FFI->new();
my $queue = $context->socket(ZMQ_PUSH);
$queue->bind(_socket_spec('queue', $$));
my $results = $context->socket(ZMQ_PULL);
$results->bind(_socket_spec('results', $$));
# push jobs to queue
my $results_expected = 0;
while (my $job = $batch->next()) {
$queue->send(Dump($job));
$results_expected++;
}
$queue->send(Dump({}));
# collect results
lib/Analizo/Batch/Runner/Parallel.pm view on Meta::CPAN
}
sub distributor {
my ($parent_pid, $number_of_workers) = @_;
my $context = ZMQ::FFI->new();
my $queue = $context->socket(ZMQ_PULL);
$queue->connect(_socket_spec('queue', $parent_pid));
my $job_source = $context->socket(ZMQ_REP);
$job_source->bind(_socket_spec('job_source', $parent_pid));
my @queue;
my $job;
while(1) {
my $msg = $queue->recv();
$job = Load($msg);
last if !exists($job->{id});
push(@queue, $job);
}
t/samples/android-framework/android-5.1.1_r38/AudioTrackShared.cpp view on Meta::CPAN
total.tv_sec--;
}
if ((total.tv_nsec += deltaNs) >= 1000000000) {
total.tv_nsec -= 1000000000;
total.tv_sec++;
}
before = after;
beforeIsValid = true;
}
switch (errno) {
case 0: // normal wakeup by server, or by binderDied()
case EWOULDBLOCK: // benign race condition with server
case EINTR: // wait was interrupted by signal or other spurious wakeup
case ETIMEDOUT: // time-out expired
// FIXME these error/non-0 status are being dropped
break;
default:
status = errno;
ALOGE("%s unexpected error %s", __func__, strerror(status));
goto end;
}
t/samples/android-framework/android-5.1.1_r38/AudioTrackShared.cpp view on Meta::CPAN
// Both of these barriers are required
if (mIsOut) {
int32_t rear = cblk->u.mStreaming.mRear;
android_atomic_release_store(stepCount + rear, &cblk->u.mStreaming.mRear);
} else {
int32_t front = cblk->u.mStreaming.mFront;
android_atomic_release_store(stepCount + front, &cblk->u.mStreaming.mFront);
}
}
void ClientProxy::binderDied()
{
audio_track_cblk_t* cblk = mCblk;
if (!(android_atomic_or(CBLK_INVALID, &cblk->mFlags) & CBLK_INVALID)) {
android_atomic_or(CBLK_FUTEX_WAKE, &cblk->mFutex);
// it seems that a FUTEX_WAKE_PRIVATE will not wake a FUTEX_WAIT, even within same process
(void) syscall(__NR_futex, &cblk->mFutex, mClientInServer ? FUTEX_WAKE_PRIVATE : FUTEX_WAKE,
1);
}
}
t/samples/android-framework/android-5.1.1_r38/AudioTrackShared.cpp view on Meta::CPAN
LOG_ALWAYS_FATAL("waitStreamEndDone() timeout=%d", timeout);
ts = NULL;
break;
}
int32_t old = android_atomic_and(~CBLK_FUTEX_WAKE, &cblk->mFutex);
if (!(old & CBLK_FUTEX_WAKE)) {
errno = 0;
(void) syscall(__NR_futex, &cblk->mFutex,
mClientInServer ? FUTEX_WAIT_PRIVATE : FUTEX_WAIT, old & ~CBLK_FUTEX_WAKE, ts);
switch (errno) {
case 0: // normal wakeup by server, or by binderDied()
case EWOULDBLOCK: // benign race condition with server
case EINTR: // wait was interrupted by signal or other spurious wakeup
case ETIMEDOUT: // time-out expired
break;
default:
status = errno;
ALOGE("%s unexpected error %s", __func__, strerror(status));
goto end;
}
}
t/samples/kdelibs/backportglobal.h view on Meta::CPAN
- https://github.com/analizo/analizo/issues/173
GitHub kdelibs repository:
- https://github.com/KDE/kdelibs.git
Original file was copied from the commit 0f4cf41b22 from kdelibs git repository
and it is located inside kdelibs repository on the path below.
- experimental/libkdeclarative/bindings/backportglobal.h
Link to the original file on GitHub:
- https://github.com/KDE/kdelibs/blob/9941ebff54bd9d4349c0384dfa0cca2ace9549c4/experimental/libkdeclarative/bindings/backportglobal.h
*/
/****************************************************************************
**
** This file is part of the Qt Script Generator.
**
** Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies).
**
** Contact: Nokia Corporation info@qt.nokia.com
t/samples/mlpack-3.0.0/parse_command_line.hpp view on Meta::CPAN
- https://github.com/analizo/analizo/issues/120
mlpack repository:
- https://github.com/mlpack/mlpack
Original file was copied from the tag mlpack-3.0.0 from mlpack git repository
and it is located on the path below.
- src/mlpack/bindings/cli/parse_command_line.hpp
Link to the original file on GitHub:
- https://github.com/mlpack/mlpack/blob/mlpack-3.0.0/src/mlpack/bindings/cli/parse_command_line.hpp
See full copyrigth info at:
- https://github.com/mlpack/mlpack/blob/mlpack-3.0.0/COPYRIGHT.txt
*/
/**
* @file parse_command_line.hpp
* @author Ryan Curtin
t/samples/mlpack-3.0.0/parse_command_line.hpp view on Meta::CPAN
* http://www.opensource.org/licenses/BSD-3-Clause for more information.
*/
#ifndef MLPACK_BINDINGS_CLI_PARSE_COMMAND_LINE_HPP
#define MLPACK_BINDINGS_CLI_PARSE_COMMAND_LINE_HPP
#include <mlpack/core.hpp>
#include <boost/program_options.hpp>
#include "print_help.hpp"
namespace mlpack {
namespace bindings {
namespace cli {
// Add default parameters that are included in every program.
PARAM_FLAG("help", "Default help info.", "h");
PARAM_STRING_IN("info", "Get help on a specific module or option.", "", "");
PARAM_FLAG("verbose", "Display informational messages and the full list of "
"parameters and timers at the end of execution.", "v");
PARAM_FLAG("version", "Display the version of mlpack.", "V");
/**
t/samples/mlpack-3.0.0/parse_command_line.hpp view on Meta::CPAN
if (!vmap.count(boostName))
{
Log::Fatal << "Required option --" << boostName << " is undefined."
<< std::endl;
}
}
}
}
} // namespace cli
} // namespace bindings
} // namespace mlpack
#endif