import threading
import time

class UnsafeSingleton:
    _instance = None

    def __new__(cls):
        if cls._instance is None:
            time.sleep(0.01)
            cls._instance = super(UnsafeSingleton, cls).__new__(cls)
        return cls._instance

instances = []

def create_instance():
    instance = UnsafeSingleton()
    instances.append(instance)

threads = [threading.Thread(target=create_instance) for _ in range(10)]

for t in threads:
    t.start()

for t in threads:
    t.join()

unique_instances = set(instances)
print(f"Создано {len(unique_instances)} уникальных экземпляров Singleton.")
