Operating system , synchronization

Consider the methods used by processes P1 and P2 for accessing their critical sections whenever needed, as given below. The initial values of shared boolean variables S1 and S2 are randomly assigned. Method used by P1

while (S1 == S2);Critical Section S1 = S2;

Method used by P2while (S1 != S2);Critical SectionS2 = not(S1);

Which one of the following statements describes the properties achieved?

Mutual exclusion but not progress

Progress but not mutual exclusion

Neither mutual exclusion nor progress

Both mutual exclusion and progress

EDIT why in such codes we cannot preempt during executing while? is while an atomic expression here?

Ubuntu 18.04 Desktop – date and time synchronization issue

I did a clean install of Ubuntu 18.04 LTS on my laptop a couple of days back. During installation, I chose the timezone to be my local time zone i.e., Kolkata, India (Indian Standard Time). However, after booting my system, the time and date are showing incorrect values.

Displayed values:

date: Sun Aug 11 2019 time: 06:21:xx

Actual values at that time:

date: Sat Aug 10 2019 time: 19:21:xx

Precisely, the displayed time is 11 hours ahead of the actual time.

wrong date and time

In Settings –> Date and Time, the Automatic Date and Time, and the Automatic Time Zones switches are also enabled.

auto-update-date-and-time-enabled

I found some articles on the internet using which I tried to analyze/fix the issue (Screenshots attached).

  1. Run timedatectl

Local time: Sun 2019-08-11 06:27:44 IST Universal time: Sun 2019-08-11 00:57:44 UTC RTC time: Sun 2019-08-11 00:57:44 Time zone: Asia/Kolkata (IST, +0530) System clock synchronized: yes systemd-timesyncd.service active: yes RTC in local TZ: no

  1. Installed ntp

$ sudo dpkg -s ntp | grep Status Status: install ok installed

  1. Run sudo ntpq -p

ntpq command output

  1. Run sudo nmap -p123 -sU -P0 localhost. I think it checks the status of UDP port 123.

upd-port-123-status-check

What should be the next steps I need to perform to fix this issue?

SharePoint 2016 : User Profile Synchronization Status Idle

Need you Urgent Support. Got stuck in setup of User profile service application in SharePoint 2016. Tried below solutions.

All Setup Done. Required Permissions given like Replicating Directory permissions.

Tried Service application pool with with Farm Service account.

Many time restarted Timer service

Also restart IIS .

I am getting below error in log file.

“0x18F8 SharePoint Portal Server User Profiles g22d High UserProfileApplication.DumpSynchronizationStatusToFile: Unexpected exception: System.NullReferenceException: Object reference not set to an instance of an object. at Microsoft.Office.Server.Administration.UserProfileApplication.DumpSynchronizationStatusToFile()”.

Please help me in resolving this issue. Not getting enough support. Thanks:Sunil

Design question on synchronization of two asynchronous data streams

I have two async streams suppose- Trip : {tripId, date, city} Bill : {billId, tripId, date, amount}. I need to design a system to get real time aggregated view of following nature: City, TripCount, TotalAmount. Events in both streams can be out of sync or duplicate. But result needs to be accurate and realtime.

My Solution:

1.) Create two different DB tables: Trip and Bill (indexed on TripID and BillID). Read the messages from the streams and persist in these tables with the status column as pending in Bill table and Trip table. Then write a worker which will read from the bill table and look into the Trip table for the record containing the given tripID. If the record is found it will update the aggregated view in third table (City, TripCount, TotalAmount). Then we will change the state of the bill and trip record to processed. There will be one background job running on periodic basis which will remove all the records which will have the state as processed from both Bill and Trip table.

The problem i see with the above solution is the indexing that done on the TripID and BillID will become a bottle neck if i remove the records at very high frequency. Other from it do you guy see any other problem with this solution. I have read on internet that people are suggesting it as very famous anti-pattern cause here i am using DB as queue.

2.) Here is other solution: Take the data from the streams, persist it in the tables: Trip, Bill (for audit purpose of records and to avoid duplicates). For storing the Trip data temporarily take one distributed key-value pair very fast data structure. I am taking REDIS for this purpose. So, after writing trip data to DB, i will write the same data in the cache with tripid as key and record as value. Then i will put the bill data in the queue. Workers will be reading from the queue and will lookup into the cache for the tripid. If the tripid is present then the workers will read the data from cache and update the aggregated view and delete the tripid from the cache and also bill message from the queue. If the tripid is not found in the cache then then worker will again put the same message in the queue back.

To avoid duplicates, the insertion will fail if we will try to insert same tripid or billid in the tables. In case where the insertion will fail, i will not put the message in the queue and cache.

Experts please let me know about your thoughts on the above two solutions and please propose any better solution if you have any.

How to update Job Title property in User Profile Synchronization?

I am using SharePoint 2016. I ran user profile full synchronization, but Job Title and Organization chart(Manager name) are NOT getting “updated” from Active Directory to SharePoint. For example, the new employee information is being added correctly, but existing employees Job Title, manager, etc are not updating. Also, employees deleted in AD are also not being updated in SharePoint. Can someone give me an explanation for this? Thank you Kalai

Mobile application – data synchronization between multiple devices in local network

I want to create an mobile application on Android devices but never done applications like this before.

I have several devices that are connected to the same local network without access to the Internet. I want to make one of this devices as master, other will be slaves. If master write text on screen – slaves get this text instantly on their screen or after clicking “send” button on master device.

I’ve tried to find something on the Internet but didn’t find any clues. Can anyone tell me if there is any way to do that application?

User Profile synchronization connection has been deleted but still user profiles show up in SharePoint

We have SharePoint 2013 environment and we have 2 AD connections (ie. 2 different domains) in User Profile Service Application. All the users from DomainA have been moved to DomainB and AD team have created new user accounts for these users. Now I want to delete the old user accounts of DomainA. So , I went ahead and deleted the DomainA connection and ran a full synchronization and this did not resolve my issue. As domainA users still show up in SharePoint.

AD Import is the synchronization method we are using to import users from AD.

Appreciate any help 🙂

Synchronization of Asynchronous Communication

I have n nodes communicating with a coordinator with asynchronous communication, and the coordinator sends messages to the nodes with asynchronous communication too.

I would like to ask if there is bibliography about the synchronization of asynchronous communication, because there a lot of synchronization problems of my implementation.

Thanks in advance!