---------- Forwarded message ---------- Date: Mon, 15 Mar 2004 10:42:23 +0800 (PHT) From: [EMAIL PROTECTED] To: True Computer Science Mailing List <[EMAIL PROTECTED]> Subject: Re: [plug] Thread vs. Process overhead: *nix vs. Linux
I believe on Sat, 13 Mar 2004, it was Andy Sy who wrote: > Orlando Andico wrote: > > > 30,000 threads with NPTL. That's on a very large machine though. > > Note that I am talking about _process_ creation not thread > creation. Anyway, I found the answer within seconds of > Googling for it (woohoo!) and it was very interesting and > remarkable. > > From http://www.itworld.com/nl/lnx_tip/02092001/ > > "Under Linux, threads and processes are almost indistinguishable > except for one thing: threads run within the same address space > whereas processes have distinct address spaces. However, no > differences exist between the two from a scheduler point-of-view. > Thus, a context switch between two threads of the same process > essentially jumps from one code location to another, plus setting > a few CPU registers." Im not really sure what youre asking about. is it the overhead of a 'started process' vs. threading. but would the idea of of -shared memory- mean to you? (vs). a process *bieng started* envolving the kernel and the process requesting systems resources, (tapping the filesystem, allocation of the arrays data struc of pointers and initializing some pointer identifiers .. etc).. of course those tasks has greater "overhead" and consumes more cpu resources ... than duplicating a 'clone' to that already-running process. IMO, threading is like a "garden" of common and shared memory. when the system needs another copy of that process, then, since it, being shared, it envolves no more than assigning an identifier to that process, then letting the sending process write directly into the recv buffer of the other process. > > Certainly a fundamental distinguishing factor between Linux > and the SVR4/BSD derived OSes... Anyway, I would certainly welcome > further comments and experiences regarding this topic. simple C programming, using memmap /dev/zero before forking, then letting the processes access them afterwards <-> than, executing a new 'lonely and unique' process. by the structures and the calling functions of each program itself, one could dittermine which has a higher overhead. -=-=-=-=-=-=-=-=-=-=- - stderr(Cagayan de Oro, 'Federalismo!') -- Philippine Linux Users' Group (PLUG) Mailing List [EMAIL PROTECTED] (#PLUG @ irc.free.net.ph) Official Website: http://plug.linux.org.ph Searchable Archives: http://marc.free.net.ph . To leave, go to http://lists.q-linux.com/mailman/listinfo/plug . Are you a Linux newbie? To join the newbie list, go to http://lists.q-linux.com/mailman/listinfo/ph-linux-newbie
