Closed Bug 160724 Opened 23 years ago Closed 23 years ago

Rev test case for memory mapping and semaphores

Categories

(NSPR :: NSPR, defect, P5)

defect

Tracking

(Not tracked)

RESOLVED INVALID

People

(Reporter: mozilla, Assigned: mozilla)

References

Details

(Whiteboard: [prof sharing])

Attachments

(1 file, 4 obsolete files)

We need the NSPR named shared memory and semaphores for the profile sharing work. Need to make sure the code is working on all 3 main platforms.
Status: NEW → ASSIGNED
Priority: -- → P1
This modifies the ptsynch.c file to use SEM_UNDO and adds 2 new shared memeory test cases. The first uses a single semaphore for the memory mapping ( unlike the original test that used one per thread - 2 ) and the second writes characters to test the ability of the OS to handle us writing over the end of the memory to see if it will grow. These have been run on Win2k sp2 and RH7.2 successfully, Mac OSX is next
For Mac the decision has been made to focus on mach-o compatibility to start ( this means Mac OSX will be support through the Unix apis ). If cfm support is needed that will be added later ( would mean a carbon based layer would have to be added to get at the Unix commands ). Building mach-o now, should be able to test later this afternoon.
Summary: [prof sharing] Rev test case for memory mapping and semaphores → Rev test case for memory mapping and semaphores
Whiteboard: [prof sharing]
Blocks: 135137
Attached file new test case, for unix only (obsolete) —
test developed on RH7.2 ( works ) to test MacOSX shared memory support. This does a straigh fork(), unlke the nspr PR_CreateProcess() which does a forkandexec(). Hopefully this will solve the problem...
Got the tests running on Mac OSX with some modification to the test. Need to clean them up before finally posting them. It seems that we are going to need some way of testing the semaphore and shared memory when we detach from them so we know if we can destroy them. I know there is a call that will return the status for...I think it's SysV shared memory. That way a process can tell if it is the last to be attached to the memory, and then it can delete it. But I think we are going to need that functionality for Win/POSIX/SysV semaphore and shared memory. This is the only way I can think of for processes to know to delete these objects and premature deletion is Not Good(tm).
Attached file new test, XP (obsolete) —
This test is made to be run mulitple times from the command line, to better simulate the type of conditions we will see running multiple moz instances (hopefully its more accurate).
This contains nameshm[2-5].c and the fixes needed for them. Does not include the UNDO flag for the Unix systems, I'll roll that in when I test this patch on Linux. Adds the nspr call PR_NumAttachedToSharedMemory to find out when processes are finished with a specific named shared memory segment.
Attachment #93795 - Attachment is obsolete: true
Attachment #95922 - Attachment is obsolete: true
Attachment #96230 - Attachment is obsolete: true
Attachment #96723 - Attachment is obsolete: true
Wan-teh, could you look at the last patch. I've tested on Win2k, RedHat7.2, and OSX (mach-o). Everything is working except for one slight problem on RH, which really isn't a problem, but a side affect we have to work around ( when a semaphore gets deleted you can't re-attach like you can on mac & win ) There doesn't seem to be a way to find out how many processes are still holding on to a semphore in either POSIX or SYSV, like you can with SYSV Shared Memory ( nattach ), only how many processes are actually blocked on a semaphore. I added to the NSPR api a method for finding out how many processes are attached to shared memory. However, the only system that has an implementation is SysV. POSIX doesn't have a way of getting that number, nor does windows but it seems windows is much more leinient about re-attaching even after closing the shared memory.
marking this as invalid, as the nspr code is not needed for profile sharing.
Status: ASSIGNED → RESOLVED
Closed: 23 years ago
Priority: P1 → P5
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: