Sponsored Content
The Lounge What is on Your Mind? Speculative Shell Feature Brainstorming Post 302514766 by tetsujin on Monday 18th of April 2011 01:48:10 AM
Old 04-18-2011
Quote:
Originally Posted by Corona688
When you make copies of the memory, the memory won't propagate back unless you propagate it yourself. Which opens an even bigger can of worms than just using the originals -- when and if to propagate back.
If it's shared memory you don't make copies. You write to the shared memory and all processes that share that memory see the change. (The same would be true if "subshells" meant to operate on the same environment were threads instead of fork()'ed processes sharing memory - only the sharing mechanism differs.)

If you were saying that the "shell variables" (i.e. the shell's copy of all variables defined in the shell - the working copy shared with all shell processes or threads that are part of the current shell instance) don't propagate back to the "environment variables" (that is, the variables defined in "environ", accessible via C calls to getenv(), etc. in the shell's process) - they don't need to. The only time the shell needs to access its environment variables is at startup, to import those variables into its own working memory. When it runs a command, it forms a new environment including those variables that were exported...

(EDIT): I don't know, maybe I misunderstood you. I guess there is a side to this that I kind of glossed over. Are when you talk about the bigger can of worms, and when to "propagate back" - are you talking about cutting down on the accesses to the shared copy of the shell vars (and related semaphore actions) by pulling things in to a thread-local copy and then writing them back later? I guess that could be a bit of a headache...

Last edited by tetsujin; 04-18-2011 at 03:06 AM..
 

4 More Discussions You Might Find Interesting

1. SCO

BASH-like feature. is possible ?

Greetings... i was wondering if there is any shell configuration or third party application that enables the command history by pressing keyboard up arrow, like GNU/BASH does or are there an SCO compatible bash versio to download? where ? just wondering (sory my stinky english) (2 Replies)
Discussion started by: nEuRoMaNcEr
2 Replies

2. Shell Programming and Scripting

Creating a command history feature in a simple UNIX shell using C

I'm trying to write a history feature to a very simple UNIX shell that will list the last 10 commands used when control-c is pressed. A user can then run a previous command by typing r x, where x is the first letter of the command. I'm having quite a bit of trouble figuring out what I need to do, I... (2 Replies)
Discussion started by: -=Cn=-
2 Replies

3. UNIX for Dummies Questions & Answers

brainstorming automated response

I am managing a database of files for which there is a drop-box and multiple users. what i would like to do is set a criteria for files coming into the drop-box based on file structure. (they must be like this W*/image/W*-1234/0-999.tif) If the files do not match the criteria i want them to be... (1 Reply)
Discussion started by: Movomito
1 Replies

4. UNIX for Beginners Questions & Answers

Can we create any check-point feature in shell ?

I have a script as below and say its failed @ function fs_ck {} then it should exit and next time i execute it it should start from fs_ck {} only Please advise #!/bin/bash logging {} fs_ck {} bkp {} dply {} ## main function### echo Sstarting script echo '####' logging fs_ck... (3 Replies)
Discussion started by: abhaydas
3 Replies
fsapadm(1M)															       fsapadm(1M)

NAME
fsapadm - VxFS allocation policy administration utility SYNOPSIS
metadata_policy_name flags] filename data_policy_name metadata_policy_name flags] order] mount_point policy_name volname... DESCRIPTION
The utility performs administrative tasks, such as assigning, defining, deleting, and enforcing allocation policies in a specified VERITAS File System. policy_name specifies the name of an allocation policy. The maximum length of an allocation policy name is 64 characters. mount_point specifies the directory on which the file system is mounted. Keywords Assigns allocation policies to a Storage Checkpoint. Assigns allocation policies to an individual file. Possible values for flags are: Set this flag on a directory and subsequently the files created in the directory will inherit the allocation policies. Assigns the default allocation policies for an entire file system. Defines a new allocation policy or changes an existing allocation policy named policy_name at the specified mount point. In the latter case, the previously specified volumes are replaced by the newly specified volumes. Possible values for order are: Allocations are done from the volume in the order in which they are given in the allocation policy. Allocations are done from the volume specified in the allocation policy that has the most free blocks. Allocations are done from a volume that is selected in a round-robin fashion from those specified in the allocation policy. The default order is Possible values for flags are: Allows non-privileged users to be able to assign the policy using the keyword. By default, only privileged users can assign policies. Deletes an allocation policy. Enforces the allocation policies assigned to an individual file by moving any data and metadata that does not fulfill its assigned allocation policy into new blocks that do fulfill its assigned allocation policy. Displays the definitions of all allocation policies defined in a file system. Displays the definition of an allocation policy. Displays the allocation policies assigned to an entire file system. Displays the allocation policies assigned to a Storage Checkpoint. Displays the allocation policies assigned to an individual file. EXAMPLES
The following command defines an allocation policy named using volumes and with order in the file system mounted at The following command deletes the allocation policy named from the file system mounted at The following command displays the definition of the allocation policy named in the file system mounted at The following command assigns the allocation policies named and as the default policies for data and metadata, respectively, for all files in the file system mounted at The following command assigns the allocation policy named as the default policy for data and metadata, respectively, for the Storage Check- point in the file system mounted at The following command assigns the allocation policy named for data and metadata, respectively, to the file The following command displays the allocation policies assigned as the defaults for all files in the file system mounted at The following command displays the allocation policies assigned to the Storage Checkpoint in the file system mounted at The following command displays the allocation policies assigned to the file in the file system mounted at The following command enforces the allocation policies assigned to the file in the file system mounted at (that is, the existing alloca- tions are moved to match the policies, if required): SEE ALSO
fsadm_vxfs(1M), fsckptadm(1M), fsvoladm(1M). fsapadm(1M)
All times are GMT -4. The time now is 11:02 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy