how does fork() copy threads of a process in multi-processor (SMP)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I've a general question:  In Multiprocessor (Multi-Core) (SMP)
environment how does  fork system call  (do_fork() related code)
maintain the synchronization in case the threads of a process are
running on different processors?  E.g. it can happen that the fork()
is called by cpu-0 thread and other thread of same process is
executing on cpu-1.

I can see that copy of the process is made by do_fork() code in
fork.c.  Can anyone give more details how the concurrency issue gets
handled e.g. how  PC and Regs are of cpu-1 thread get copied without
any race condition in SMP / multiprocessor system?

Thanks in advance

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@xxxxxxxxxxxxxxxxx
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies



[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux