On Fri, 16 Feb 2007, Amos Shapira wrote:

On 16/02/07, Peter <[EMAIL PROTECTED]> wrote:

Atomic code execution should not require assembly because segment
locking can be done using C (even if that C is inline assembly for
some applications).

And how would you implement the lock on the segment?

(assuming I guess correctly what you mean by "segment locking", the closest
I found was related to ELF file segments and POSIX file segment locking).

By segment I mean the relevant variables of the process. Atomic code execution cannot be guaranteed at user level in a premptive multitasking system. However the system guarantees thread privacy. The only way to make things 'atomic' it to run the process with root privileges and switch the sheduler to SCHED_RR and assign it a high priority. Even so hw interrupts will interrupt it. So only kernel mode code can be 'atomic'. That or realtime extensions (which are equivalent to SCHED_RR in kernel mode).

Peter

=================================================================
To unsubscribe, send mail to [EMAIL PROTECTED] with
the word "unsubscribe" in the message body, e.g., run the command
echo unsubscribe | mail [EMAIL PROTECTED]

Reply via email to