Then, which library is used to create multithreaded programs? Because that'd be relevant to the original exit() vs. exit_group() problem.
Steve, when you wrote, "Yes, Gabe's right... in SE mode, the Process object corresponds to what would be a regular OS process if you had an OS, so the way to tell that two threads belong to the same process is whether they're associated with the same Process object...", you were talking about multiple threads spawned from a single parent process, weren't you? regards, Soumyaroop. On Fri, Sep 4, 2009 at 3:32 PM, Steve Reinhardt<[email protected]> wrote: > (Yes, let's keep this on m5-dev. That's better policy since it lets > others chime in, plus then the discussion gets archived for > posterity.) > > The key issue is that SE mode does not support the Linux pthreads > library... it's just too complicated (see > http://m5sim.org/wiki/index.php/Splash_benchmarks). Daniel Sanchez at > Stanford has written a lightweight pthreads library that uses a much > reduced set of syscalls that SE mode does support; I don't recall off > the top of my head if/where that is available though (Daniel?). > > The other option is to use the hokey PARMACS macros and an even hokier > library I wrote to support them under Tru64 long long ago; that's what > the downloadable SPLASH benchmarks are based on. That's pretty > obsolete though, and I'm not sure you could even get any new apps to > compile with that. > > Steve > > On Wed, Sep 2, 2009 at 6:03 PM, soumyaroop roy<[email protected]> wrote: >> Thanks, Steve. >> >> However, after Gabe's email and your subsequent reply to it, I am confused >> about how a multithreaded program would be simulated in the SE mode. If I >> were to use, say, pthread_create() to create 2 threads (which I assume would >> probably be translated into the clone() system call), how (or when) would >> the two threads get mapped on to separate h/w threads? >> >> I tried out simulating a multithreaded "hello world" program (source >> attached) but I get the error "fatal: syscall set_tid_address (#411) >> unimplemented". I checked the disassembled code and this system call appears >> to be made from within the function "__pthread_initialize_minimal" which is >> called by "__libc_start_main" >> >> I modified the test.py to look like this: >> >> process1 = LiveProcess(cmd = 'hello.2t', executable = binpath('hello.2t')) >> process2 = LiveProcess(cmd = 'hello.2t', executable = binpath('hello.2t')) >> >> root.system.cpu.workload = [process1, process2] >> root.system.cpu.numThreads = 2 >> >> Am I doing it wrong? >> >> Actually, I sent my last email only to you because I thought that it would >> be more efficient to work out the details with you without flooding >> everybody's mailboxes. However, please let me know if you would rather have >> me post this on m5-dev. >> >> regards, >> Soumyaroop. >> >> On Tue, Sep 1, 2009 at 6:13 PM, Steve Reinhardt <[email protected]> wrote: >>> >>> On Tue, Sep 1, 2009 at 9:10 AM, soumyaroop roy<[email protected]> wrote: >>> > In any case, if you give me some directions on how to fix it (and have >>> > the >>> > time to do so), I can work on it. >>> >>> That would be great... conceptually it's pretty simple: >>> >>> 1. find the Process object associated with the thread calling exit_group() >>> 2. iterate over the still-running threads associated with that Process >>> and halt them >>> 3. if all of the threads in the system are halted, then schedule an >>> event to exit the simulation (like we do for exit()) >>> >>> The IDs of the threads are in the Process object, in the contextIds >>> vector, so I think all the information you need is there. >>> >>> Let me know if you have any questions... >>> >>> Steve >> >> >> >> -- >> Soumyaroop Roy >> Ph.D. Candidate >> Department of Computer Science and Engineering >> University of South Florida, Tampa >> http://www.csee.usf.edu/~sroy >> > _______________________________________________ > m5-dev mailing list > [email protected] > http://m5sim.org/mailman/listinfo/m5-dev > -- Soumyaroop Roy Ph.D. Candidate Department of Computer Science and Engineering University of South Florida, Tampa http://www.csee.usf.edu/~sroy _______________________________________________ m5-dev mailing list [email protected] http://m5sim.org/mailman/listinfo/m5-dev
