PrevUpHomeNext

utx::async


utx::async

utx::async is used to create asynchronous std::future thread. Unlike std::async, utx::async is always in async mode: std::launch::async. If the operating system or runtime environment does not support asynchronous thread model, utx::async prefers crash, not continue creating a non-asynchronous thread.

utx::async is based on std::async, that utx::async will call std::async.

c++ example

#include <utxcpp/thread.hpp>
#include <utxcpp/core.hpp>

int main()
{
	std::future<void()> f1 = utx::async([] {utx::print("Hello c++!");});
	auto f2 = utx::async([] {utx::print("c++ Hello!");});
}

See Also

utx::deferred

utx::ydzs

utx::mutex0~9

utx::print


PrevUpHomeNext

utx::print

esv::print