Why (most?) retro computer emulators are single threaded?

All real computer hardware works in parallel. So why most emulators of retro systems (like NES) are single threaded (or I’m not right?)? You have main loop and you counting CPU cycles and after certain cycles activating other hardware like PPU.

Same thing applies to IBM PC and (MDA/CGA/VGA) emulation?

1

Because most retro-computers had only one CPU (i.e. one core, in today’s terminology).

Emulating in parallel a sequential computation is not reasonable (and realistically not feasible).

The graphical cards (or other devices) at that time did not “compute”, only “display” (or do input/output). No need to emulate it in parallel.

And the rare exceptions (for instance Channel I/O on IBM/360 did some simple computation in parallel) don’t deserve a complex multithreaded emulator.

Also, emulators are often complex to code but today they run faster than the emulated hardware, so there is no reason to spend efforts in accelerating them by multithreading.

It might be different if you wanted to emulate at the lowest hardware level, e.g. emulating the physics of each transistor.

BTW, you could try to write your own (maybe multithreaded!) simulator in free software (perhaps by contributing to unisim)

I’ve actually asked myself this question.

The accepted answer makes some reasonable statements, especially regarding the systems and acronyms mentioned by the OP. For sure, true multithreaded emulators don’t give us much at the emulation level.

However, I’ve been looking at getting truer emulation of a KIM-1 board, with more complete RRIOT emulation, with usable maskable and non-maskable interrupts for the purpose of timers (i.e., timers that can be scaled, restarted, and accessed by the programmer).

One approach there is an implementation of multitasking in the emulator (which doesn’t have to actually be truly parallel) so we have independent timers (or a single timer) that can be scaled, hooked up to “interrupts”, etc. That is, user code could run that checks memory locations for timer info that is supposed to be ticking over even as our own program statements are being stepped through. More importantly, it might be a good way to emulate interrupts that a program subscribes to, allowing our own interrupt handlers to work as expected.

The intention is to emulate more closely the machinery of the CPU and support chips so that the registers, programmable interrupts, and read-only memory locations that change as the hardware ticks behave more as expected. But doing it without coding it at the tricky per opcode load-and-execute level.

I think it might be easier to emulate the target CPU speed a little closer, too, or at least get timer resolution pretty accurate. That is, what happens between the various timer location updates and interrupts is not that important as long as those ticks and interrupts are correct when user and ROM routines access them.

Yeah, still a work in progress.

I think the main reason that emulators tend to be single-threaded is that you are managing a very complex state engine; emulators may be the most complex state engines in general.

When you add in multi-threading, you then have to add in locking mechanisms to keep that state engine in proper synchronization. As emulators tend to be emulating older hardware anyway, the performance gain is seldom enough to justify the huge increase in complexity.

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật