Path: utzoo!attcan!uunet!snorkelwacker!bloom-beacon!eru!hagbard!sunic!kth.se!cyklop.nada.kth.se!samuel From: samuel@nada.kth.se (Samuel Cederlind) Newsgroups: comp.sys.next Subject: Threads and fork() on the NeXT Summary: Question on Mach Keywords: Mach Message-ID: <1990Sep15.212827.25360@nada.kth.se> Date: 15 Sep 90 21:28:27 GMT Sender: Samuel Cederlund, samuel@nada.kth.se Distribution: comp Organization: Royal Institute of Technology, Stockholm, Sweden Lines: 19 How come forking C-threads on the NeXT does not work after having done a unix fork() call? As I ported the public domain XScheme to our NeXT, I made an object extension to it, originally because we wanted to build an adventure game. Mach made it very easy to make it a multi-user game. Using the Mach operating system, objects can communicate nicely with- out knowing the borders of their tasks. It would then be very convenient if objects could be "forked off" into new processes. There is a function in the NeXT Reference Manual, task_create(), very briefly documented. In the Mach manuals it says: > Note: Not implemented yet. Use fork. So I have. There are three or so threads that always need to be running for the communication between objects. After a fork(), you have to create all threads anew, right? Anyway, there I'm stuck. This seems an insoluble problem. cthread_fork() yields an error, and sticks. Is there any reason why this should be?