Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 30 Apr 2015 02:01:36 -0700
From:      "K. Macy" <kmacy@freebsd.org>
To:        Stefan Andritoiu <stefan.andritoiu@gmail.com>
Cc:        freebsd-virtualization@freebsd.org
Subject:   Re: How to tell if current running thread can be preempted?
Message-ID:  <CAHM0Q_Pi8YTc%2BQLeehJfdmS8QwqUMFM5y741sEmxd1ih0%2Bav6g@mail.gmail.com>
In-Reply-To: <CAO3d8=aZezp%2B1MgJJFtCeb0GpTeZNwoWOW7iK0bQzaTktkZHwA@mail.gmail.com>
References:  <CAO3d8=aZezp%2B1MgJJFtCeb0GpTeZNwoWOW7iK0bQzaTktkZHwA@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Any thread can be preempted unless it's in a critical section which is
tracked by a counter in the current thread.

There would be no OS agnostic way of doing what you ask in your second
question.
On Apr 28, 2015 4:26 PM, "Stefan Andritoiu" <stefan.andritoiu@gmail.com>
wrote:

> In Linux, in the scheduler function, it check if(!preempt_count() &
> PREEMPT_ACTIVE).
> How does the ULE scheduler tell if it can preempt the current thread?
> Is there an equivalent to the preempt_count() function and the
> PREEMPT_ACTIVE macro?
>
> Also, can this information, of a current thread running inside a
> FreeBSD virtual machine on bhyve, be accessed from the host?
> _______________________________________________
> freebsd-virtualization@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-virtualization
> To unsubscribe, send any mail to "
> freebsd-virtualization-unsubscribe@freebsd.org"
>



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAHM0Q_Pi8YTc%2BQLeehJfdmS8QwqUMFM5y741sEmxd1ih0%2Bav6g>