Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7309127
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T23:40:42+00:00 2026-05-28T23:40:42+00:00

I was playing a bit with the MSIL decompiler – ILDASM and I tried

  • 0

I was playing a bit with the MSIL decompiler – ILDASM and I tried to decompile a simple .NET method.

The opcodes looked somehow like this:

.method private hidebysig static int32  Add(int32 a,
                                            int32 b) cil managed
{
  // Code size       18 (0x12)
  .maxstack  2
  .locals init ([0] int32 c,
           [1] int32 d,
           [2] int32 CS$1$0000)
  IL_0000:  nop
  IL_0001:  ldarg.0
  IL_0002:  ldc.i4.5
  IL_0003:  add
  IL_0004:  stloc.0
  IL_0005:  ldarg.1
  IL_0006:  ldc.i4.s   10
  IL_0008:  add
  IL_0009:  stloc.1
  IL_000a:  ldloc.0
  IL_000b:  ldloc.1
  IL_000c:  add
  IL_000d:  stloc.2
  IL_000e:  br.s       IL_0010
  IL_0010:  ldloc.2
  IL_0011:  ret
}

What I’m wondering is – are these opcodes atomic? i.e In a preemptive scheduling kernel, is it possible for a single opcode to be preempted before it finishes execution? The opcode in here could be easily mapped to asm instructions pretty much 1:1, as they have separate opcodes for loads, stores, add, etc.

But what in case of a more complex opcodes? like “call”, when the operand is a method-reference token that should first be followed to resolve the method and then called? is that atomic too?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T23:40:44+00:00Added an answer on May 28, 2026 at 11:40 pm

    No, not all opcodes are atomic. For example, if you use stloc or ldloc for value types which are larger than the native pointer size, that’s not guaranteed to be atomic.

    Section 12.6.6 of ECMA 335 guarantees this much:

    A conforming CLI shall guarantee that read and write access to properly aligned memory locations no larger than the native word size (the size of type native int) is atomic (see §12.6.2) when all the write accesses to a location are the same size. Atomic writes shall alter no bits other than those written.

    … but then there’s a note:

    [Note: There is no guaranteed atomic access to 8-byte data when the size of a native int is 32 bits even though some implementations might perform atomic operations when the data is aligned on an 8-byte boundary. end note]

    So that means any op code storing or reading an Int64 isn’t guaranteed to be atomic on x86, for example…

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been playing around a bit with a fairly simple, home-made search engine,
I started playing a bit with Sencha Touch. So I've built a really simple
I'm playing with an ASP.NET MVC application and I've run into a bit of
I'm playing a bit around with ANTLR, and wish to create a function like
I'm playing a bit with beta version of PHP Storm (PHP version of WebIDE)
Recently I've been playing a bit with Groovy and Grails and I have to
I finished NerdDinner tutorial and now I'm playing a bit with project. Index page
After playing quite a bit of Bad Company 2 over the last month, I'm
I'm playing a little bit with the new StackOverflow API . Unfortunately, my JSON
After playing around with haskell a bit I stumbled over this function: Prelude Data.Maclaurin>

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.