I’m running NASM x86_64 bit assembly on WSL. I’d have expected syscall_vfork to execute processes in parallel, yet it simply runs the parent, then the child.
bits 64
default rel
%include "stringfns.asm" ; basic print functionality
section .data
count: dw 0
section .text
global main
main:
mov r15, 0
spawner:
mov rax, 58
syscall
cmp rax, 0
je child
call debug ; prints 0n, occurs after child has finished
inc r15
cmp r15, 16
jne spawner
jmp exit
child:
mov r15, 0
.loop:
inc r15
cmp r15, 1000 ; execute child for some amount of time
jne .loop
inc word [count]
xor rsi, rsi
mov si, [count]
call iprintln ; prints integer in rsi
exit:
mov rax, 60
mov rdi, 0
syscall
I’ve also set max parallel threads to sixteen, without effect
New contributor
user26752091 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.