gabr42 / gabr42/OmniThreadLibrary

When i an object destroyed (or rather released) when send using Task.Comm.Send()?

Open
#97 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Pascal
Stars
513
Forks
147
PR merge metrics
No merged PRs in 30d

Description

Hi,

I send an object from a thread to the main thread like this:

var
U: IUnknown;
...
Task.Comm.Send(MESSAGE_ID, U);

I need to destroy all the objects before the thread ends. Normally, this is not the case: some objects are destroyed after the thread has ended.

I tried Task.Comm.Reader.Empty() and Task.Command.Writer.Empty() but with no success.

How can i force OmniThread to release the objects before the thread ends?

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by tracing Task.Comm.Send(MESSAGE_ID, U) and the Task.Comm.Reader.Empty() and Task.Command.Writer.Empty() paths, focusing on when the IUnknown reference is released relative to thread shutdown. Determine the expected release point and record or reproduce the behavior; done means the objects are released before the thread ends, or the lifecycle limitation is clearly documented.

Written by the indexing model from the issue text.

Assessment

Domain
operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.