Model queue-like work with a fixed C array and bounded loop.

Work Queue Panel

extraChoice
work_queue_panel.c
Replay: real traced execution (multi-file project)
#include <stdio.h>

int main(void) {
    int extraChoice = 1;
    const char *extra = "audit";
    if (extraChoice == 0) {
        extra = "review";
    } else if (extraChoice == 2) {
        extra = "ship";
    }

    const char *tasks[3] = {"read", extra, "write"};
    int total = 0;

    for (int i = 0; i < 3; i++) {
        printf("run:%s\n", tasks[i]);
        total++;
    }

    printf("extra=%s\n", extra);
    printf("total=%d\n", total);
    return 0;
}
#include <stdio.h>

int main(void) {
    int extraChoice = 0;
    const char *extra = "audit";
    if (extraChoice == 0) {
        extra = "review";
    } else if (extraChoice == 2) {
        extra = "ship";
    }

    const char *tasks[3] = {"read", extra, "write"};
    int total = 0;

    for (int i = 0; i < 3; i++) {
        printf("run:%s\n", tasks[i]);
        total++;
    }

    printf("extra=%s\n", extra);
    printf("total=%d\n", total);
    return 0;
}
#include <stdio.h>

int main(void) {
    int extraChoice = 2;
    const char *extra = "audit";
    if (extraChoice == 0) {
        extra = "review";
    } else if (extraChoice == 2) {
        extra = "ship";
    }

    const char *tasks[3] = {"read", extra, "write"};
    int total = 0;

    for (int i = 0; i < 3; i++) {
        printf("run:%s\n", tasks[i]);
        total++;
    }

    printf("extra=%s\n", extra);
    printf("total=%d\n", total);
    return 0;
}
  1. extraChoice ← 1, extra ← audit, tasks ← ⟨addr A⟩, total ← 0

    3int main(void) {4    int extraChoice→ 1 = 1; //@extraChoice=0, 25    const char *extra→ audit = "audit";6    if (extraChoice == 0) {7        extra = "review";8    } else if (extraChoice == 2) {9        extra = "ship";10    }1112    const char *tasks→ ⟨addr A⟩[3] = {"read", extraaudit, "write"};13    int total→ 0 = 0;
  2. total ← 1

    pass 1 of 3
    15for (int i0 = 0; i < 3; i++) {16    printf("run:%s\n", tasks[i]read);17    total→ 1++;18}
    outputrun:read
    All 3 passes — pass 1 is the card above
    passitasks[i]total
    10read0 1
    21audit1 2
    32write2 3
  3. printf("extra=%s ", extra);

    20    printf("extra=%s\n", extraaudit);21    printf("total=%d\n", total3);22    return 0;23}
    outputextra=audit
    total=3
  1. extraChoice ← 0, extra ← audit

    3int main(void) {4    int extraChoice→ 0 = 0;5    const char *extra→ audit = "audit";6    if (extraChoice == 0) {
  2. extra ← review

    5const char *extra = "audit";6if (extraChoice0 == 0) {7    extra→ review = "review";8} else if (extraChoice == 2) {
  3. tasks ← ⟨addr A⟩, total ← 0

    12const char *tasks→ ⟨addr A⟩[3] = {"read", extrareview, "write"};13int total→ 0 = 0;
  4. total ← 1

    pass 1 of 3
    15for (int i0 = 0; i < 3; i++) {16    printf("run:%s\n", tasks[i]read);17    total→ 1++;18}
    outputrun:read
    All 3 passes — pass 1 is the card above
    passitasks[i]total
    10read0 1
    21review1 2
    32write2 3
  5. printf("extra=%s ", extra);

    20    printf("extra=%s\n", extrareview);21    printf("total=%d\n", total3);22    return 0;23}
    outputextra=review
    total=3
  1. extraChoice ← 2, extra ← audit

    3int main(void) {4    int extraChoice→ 2 = 2;5    const char *extra→ audit = "audit";6    if (extraChoice == 0) {
  2. extra ← ship

    7    extra = "review";8} else if (extraChoice2 == 2) {9    extra→ ship = "ship";10}
  3. tasks ← ⟨addr A⟩, total ← 0

    12const char *tasks→ ⟨addr A⟩[3] = {"read", extraship, "write"};13int total→ 0 = 0;
  4. total ← 1

    pass 1 of 3
    15for (int i0 = 0; i < 3; i++) {16    printf("run:%s\n", tasks[i]read);17    total→ 1++;18}
    outputrun:read
    All 3 passes — pass 1 is the card above
    passitasks[i]total
    10read0 1
    21ship1 2
    32write2 3
  5. printf("extra=%s ", extra);

    20    printf("extra=%s\n", extraship);21    printf("total=%d\n", total3);22    return 0;23}
    outputextra=ship
    total=3
queue panel A fixed work list gives replay clear loop steps without depending on threads or host input.