Example #1
0
void *thread_fn(void *arg) {
	int interleave_dram = ((arg_s *) arg)->interleave_dram;
	int interleave_nvm = ((arg_s *) arg)->interleave_nvm;
	int dram_refs = ((arg_s *) arg)->mem_refs_dram;
	int nvm_refs = ((arg_s *) arg)->mem_refs_nvm;

	thread_iter(dram_refs, nvm_refs, interleave_dram, interleave_nvm);

	return 0;
}
Example #2
0
/* Set ptrace options of the given process and enable tracing of clone, fork and exec calls. */
void thread_exec(thread_t * thread) {
    process_t * process = thread->process;
    
    info("Thread %s execing.", str_thread(thread));
    
    thread_init_options(thread);
    
    /* Clear all threads except for the calling thread */
    {
        void callback(thread_t * other) {
            assert(other->process == thread->process);
            if (other != thread) {
                verbose("Thread %s died during exec.", str_thread(other));
                thread_exit(other);
            }
        }
        thread_iter(process, callback);
    }
Example #3
0
static void loop() {

    alarm(10);
    
    while (likely(!signal_quit)) {
    
        #if 0
        {
            /* sanity check */
            void tc(thread_t * thread) {
                assert(thread->references == 2);
            }
            void pc(process_t * process) {
                assert(!tree_empty(&process->threads));
                assert(process->references == 2 + tree_size(&process->threads));
                thread_iter(process, tc);
            }
            process_iter(pc);
        }