Ejemplo n.º 1
0
int
main (void)
{
	MonoThreadInfoRuntimeCallbacks ticallbacks;
	int res = 0;

	CHECKED_MONO_INIT ();
	mono_thread_info_init (sizeof (MonoThreadInfo));
	memset (&ticallbacks, 0, sizeof (ticallbacks));
	ticallbacks.thread_state_init = thread_state_init;
	mono_thread_info_runtime_init (&ticallbacks);
#ifndef HOST_WIN32
	mono_w32handle_init ();
#endif

	mono_thread_info_attach ();

	// benchmark_conc ();
	// benchmark_glib ();

	res += single_writer_single_reader ();
	res += parallel_writer_single_reader ();
	res += single_writer_parallel_reader ();
	res += parallel_writer_parallel_reader ();

	return res;
}
Ejemplo n.º 2
0
int
main (void)
{
	MonoThreadInfoCallbacks cb = { NULL };
	MonoThreadInfoRuntimeCallbacks ticallbacks;
	int res = 0;

	CHECKED_MONO_INIT ();
	mono_threads_init (&cb, sizeof (MonoThreadInfo));
	memset (&ticallbacks, 0, sizeof (ticallbacks));
	ticallbacks.thread_state_init = thread_state_init;
	mono_threads_runtime_init (&ticallbacks);

	mono_thread_info_attach ((gpointer)&cb);

	// benchmark_conc ();
	// benchmark_glib ();

	res += single_writer_single_reader ();
	res += parallel_writer_single_reader ();
	res += single_writer_parallel_reader ();
	res += parallel_writer_parallel_reader ();

	return res;
}