In my application a program can executed either in foreground or in background. when the program is executed in
the foreground , I dont want to execute certain portion of the code. Similaly, when the job is executed as a background job,
I dont want to execute certain portion of the code. Is it possible? If yes, please share the details.
Thank you in advance.